Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix livecodes template #2392

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 number used": "can we show something here?",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hatemhosny It doesn't have to be in customSettings, but is there a way to show the commit used in the imports?

dai-shi marked this conversation as resolved.
Show resolved Hide resolved
"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)}}"
}
}
}
Loading