framer-motion#domAnimation JavaScript Examples
The following examples show how to use
framer-motion#domAnimation.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: chakra.js From xetera.dev with MIT License | 6 votes |
StyleManager = ({ children }) => {
const [theme, setTheme] = useState(localStorageManager.get() ?? defaultTheme)
const toggle = previous => {
const next = previous === "dark" ? "light" : "dark"
localStorageManager.set(next)
return next
}
const chakraTheme = useMemo(() => createTheme(theme), [theme])
return (
<ThemeProvider.Provider value={{ theme, setTheme, toggle }}>
<ChakraProvider theme={chakraTheme} resetCSS={true}>
<LazyMotion features={domAnimation}>{children}</LazyMotion>
</ChakraProvider>
</ThemeProvider.Provider>
)
}