Skip to content

Commit

Permalink
fix(docs): update codesandbox code template
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 committed Jan 31, 2024
1 parent ee6f640 commit 1e6c9f5
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions packages/react-renderer-demo/src/components/code-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,16 @@ const getPayload = (code, sourceFiles = {}) =>
'@data-driven-forms/react-form-renderer': 'latest',
'@mui/material': 'latest',
'@mui/icons-material': 'latest',
react: '16.12.0',
'react-dom': '16.12.0',
'react-scripts': '3.0.1',
react: '^18.2.0',
'react-dom': '^18.2.0',
'react-scripts': '5.0.1',
},
devDependencies: {
'@types/react': '18.2.38',
'@types/react-dom': '18.2.15',
'loader-utils': '3.2.1',
typescript: '4.4.4',
},
devDependencies: { typescript: '3.8.3' },
scripts: {
start: 'react-scripts start',
build: 'react-scripts build',
Expand All @@ -153,8 +158,19 @@ const getPayload = (code, sourceFiles = {}) =>
},
},
'src/index.js': {
content:
'import React from "react";\nimport ReactDOM from "react-dom";\n\nimport App from "./App";\n\nconst rootElement = document.getElementById("root");\nReactDOM.render(\n <React.StrictMode>\n <App />\n </React.StrictMode>,\n rootElement\n);\n',
content: `import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
const rootElement = document.getElementById("root");
const root = createRoot(rootElement);
root.render(
<StrictMode>
<App />
</StrictMode>
);
`,
},
'src/App.js': {
content: code,
Expand Down

0 comments on commit 1e6c9f5

Please sign in to comment.