createContext
functionLets you create a Context that components can provide or read.
Import
import { createContext } from '@modular/sdk/editor';Notes
- see
- {@link https://react.dev/reference/react/createContext#reference React Docs}
- see
- {@link https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/context/ React TypeScript Cheatsheet}
- example
- ```tsx import { createContext } from 'react'; const ThemeContext = createContext('light'); function App() { return ( <ThemeContext value="dark"> <Toolbar /> </ThemeContext> ); } ```