deno.land / x / jotai@v1.8.4 / website / gatsby-ssr.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { MDXProvider } from '@mdx-js/react';import { Provider as JotaiProvider } from 'jotai';import { countAtom, menuAtom, searchAtom, textAtom } from './src/atoms';import { A, Code, CodeSandbox, H2, H3, H4, H5, InlineCode, Stackblitz, TOC,} from './src/components';
const components = { code: Code, inlineCode: InlineCode, CodeSandbox, Stackblitz, TOC, h2: H2, h3: H3, h4: H4, h5: H5, a: A,};
export const wrapRootElement = ({ element }) => ( <JotaiProvider initialValues={[ [countAtom, 0], [menuAtom, false], [searchAtom, false], [textAtom, 'hello'], ]} > <MDXProvider components={components}>{element}</MDXProvider> </JotaiProvider>);
export const onRenderBody = ({ setHtmlAttributes }) => { setHtmlAttributes({ lang: 'en' });};
jotai

Version Info

Tagged at
a year ago