Type inference error when creating a React Context
Advertisements I’m trying to create simple context provider in a project that uses TypeScript, typed as such: import { createContext } from ‘react’; export type ContextType = { foo: boolean, }; export const FooContext: React.Context<ContextType> = createContext({ foo: true, }); It looks simple enough, but on FooContext TypeScript is telling me that Type ‘Context<{ loading:… Read More Type inference error when creating a React Context