Skip to content

Commit

Permalink
fix livecodes template (#2392)
Browse files Browse the repository at this point in the history
* fix livecodes template

* Update .livecodes/react.json

* short sha
  • Loading branch information
dai-shi authored Feb 12, 2024
1 parent 358c39f commit dc34c6d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .livecodes/react.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
"language": "jsx",
"content": "import { StrictMode, Suspense } from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { atom, useAtom } from 'jotai';\n\nconst countAtom = atom(0);\n\nconst Counter = () => {\n const [count, setCount] = useAtom(countAtom);\n const inc = () => setCount((c) => c + 1);\n return (\n <>\n {count} <button onClick={inc}>+1</button>\n </>\n );\n};\n\nconst App = () => (\n <Suspense fallback=\"Loading...\">\n <div className=\"App\">\n <h1>Hello Jotai</h1>\n <h2>Enjoy coding!</h2>\n <Counter />\n </div>\n </Suspense>\n);\n\nconst rootElement = document.getElementById('root');\nconst root = createRoot(rootElement);\n\nroot.render(\n <StrictMode>\n <App />\n </StrictMode>\n);\n"
},
"imports": {
"jotai": "{{LC::TO_DATA_URL(./dist/esm/index.mjs)}}",
"jotai/vanilla": "{{LC::TO_DATA_URL(./dist/esm/vanilla.mjs)}}",
"jotai/utils": "{{LC::TO_DATA_URL(./dist/esm/utils.mjs)}}",
"jotai/react": "{{LC::TO_DATA_URL(./dist/esm/react.mjs)}}",
"jotai/vanilla/utils": "{{LC::TO_DATA_URL(./dist/esm/vanilla/utils.mjs)}}",
"jotai/react/utils": "{{LC::TO_DATA_URL(./dist/esm/react/utils.mjs)}}"
"customSettings": {
"jotai commit sha": "{{LC::SHORT_SHA}}",
"imports": {
"jotai": "{{LC::TO_DATA_URL(./dist/esm/index.mjs)}}",
"jotai/vanilla": "{{LC::TO_DATA_URL(./dist/esm/vanilla.mjs)}}",
"jotai/utils": "{{LC::TO_DATA_URL(./dist/esm/utils.mjs)}}",
"jotai/react": "{{LC::TO_DATA_URL(./dist/esm/react.mjs)}}",
"jotai/vanilla/utils": "{{LC::TO_DATA_URL(./dist/esm/vanilla/utils.mjs)}}",
"jotai/react/utils": "{{LC::TO_DATA_URL(./dist/esm/react/utils.mjs)}}"
}
}
}

0 comments on commit dc34c6d

Please sign in to comment.