TypeScript definitions for React, the popular JavaScript library for building user interfaces
80
{
"context": "This evaluation assesses how well the engineer uses React's Context API, specifically the useContext hook along with createContext and Provider, to implement a theme management system. The focus is on proper context creation, provision, and consumption.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Context Creation",
"description": "Uses React.createContext() to create a context for theme management with appropriate TypeScript typing (ThemeContextValue or similar)",
"max_score": 20
},
{
"name": "Provider Implementation",
"description": "Implements a ThemeProvider component that uses the Context.Provider component to wrap children and provide theme state and toggle function",
"max_score": 25
},
{
"name": "useContext Hook Usage",
"description": "Uses the useContext() hook in ThemeDisplay and ThemeToggleButton components to consume the theme context value",
"max_score": 30
},
{
"name": "State Management",
"description": "Uses useState() hook within the ThemeProvider to manage the current theme state and properly updates it via the toggleTheme function",
"max_score": 15
},
{
"name": "Context Value Shape",
"description": "Provides a context value object containing both the current theme and toggleTheme function, matching the ThemeContextValue interface specification",
"max_score": 10
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-types--reactdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10