Skip to content

Commit ee1d4c6

Browse files
committed
Update codesandbox code template
1 parent ee6f640 commit ee1d4c6

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

packages/react-renderer-demo/src/components/code-example.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,16 @@ const getPayload = (code, sourceFiles = {}) =>
138138
'@data-driven-forms/react-form-renderer': 'latest',
139139
'@mui/material': 'latest',
140140
'@mui/icons-material': 'latest',
141-
react: '16.12.0',
142-
'react-dom': '16.12.0',
143-
'react-scripts': '3.0.1',
141+
react: '^18.2.0',
142+
'react-dom': '^18.2.0',
143+
'react-scripts': '5.0.1',
144+
},
145+
devDependencies: {
146+
'@types/react': '18.2.38',
147+
'@types/react-dom': '18.2.15',
148+
'loader-utils': '3.2.1',
149+
typescript: '4.4.4',
144150
},
145-
devDependencies: { typescript: '3.8.3' },
146151
scripts: {
147152
start: 'react-scripts start',
148153
build: 'react-scripts build',
@@ -153,8 +158,19 @@ const getPayload = (code, sourceFiles = {}) =>
153158
},
154159
},
155160
'src/index.js': {
156-
content:
157-
'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',
161+
content: `import { StrictMode } from "react";
162+
import { createRoot } from "react-dom/client";
163+
164+
import App from "./App";
165+
166+
const rootElement = document.getElementById("root");
167+
const root = createRoot(rootElement);
168+
root.render(
169+
<StrictMode>
170+
<App />
171+
</StrictMode>
172+
);
173+
`,
158174
},
159175
'src/App.js': {
160176
content: code,

0 commit comments

Comments
 (0)