create context
https://react.dev/reference/react/createContext
context.ts
import {createContext} from 'react';
export interface ContextProps {
darkTheme: boolean;
}
export const AppContext = createContext<ContextProps>({
darkTheme: true,
});
App
const Context2 = Context as React.Context<ContextProps>;
return (
<AppContext2.Provider value={{darkTheme: false}}>
{/* -- content -- */}