The ThemeEditorProvider
component creates the root object state of HyperTheme and provides functionalities through the useThemeEditor
hook (under the hood it uses recoil
, check it out here).
It needs to be placed inside the ChakraProvider
component and you can have only one ThemeEditorProvider
inside your application.
View source
@hypertheme-editor/chakra-ui-core
leads to a known issue with recoil
.@hypertheme-editor/chakra-ui
or @hypertheme-editor-pro/chakra-ui
.Inside the root component of your application do this:
import * as React from 'react'import { ChakraProvider } from '@chakra-ui/react'import theme from './my-theme'// 1. import `ThemeEditorProvider` componentimport { ThemeEditorProvider } from '@hypertheme-editor/chakra-ui'function App() {// 2. Add the `ThemeEditorProvider` component just below the `ChakraProvider` componentsreturn (<ChakraProvider theme={theme}><ThemeEditorProvider><Component /></ThemeEditorProvider></ChakraProvider>)}
If you have a PRO license, import ThemeEditorProvider
from @hypertheme-editor-pro/chakra-ui
:
import * as React from 'react'import { ChakraProvider } from '@chakra-ui/react'import theme from './my-theme'// 1. import `ThemeEditorProvider` componentimport { ThemeEditorProvider } from '@hypertheme-editor-pro/chakra-ui'function App() {// 2. Add the `ThemeEditorProvider` component just below the `ChakraProvider` componentsreturn (<ChakraProvider theme={theme}><ThemeEditorProvider><Component /></ThemeEditorProvider></ChakraProvider>)}
Prev
Next