Skip to content

Commit c31dd3b

Browse files
authored
Merge pull request #1320 from data-driven-forms/update-react-dependency-to-18
Update react dependency to 18
2 parents bf5748c + 51dda8f commit c31dd3b

File tree

10 files changed

+378
-323
lines changed

10 files changed

+378
-323
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
"@semantic-release/git": "^10.0.1",
7373
"@semantic-release/github": "^8.0.2",
7474
"@semantic-release/npm": "^8.0.3",
75-
"@testing-library/dom": "^8.11.2",
76-
"@testing-library/jest-dom": "^5.16.1",
77-
"@testing-library/react": "^12.1.2",
78-
"@testing-library/user-event": "^14.1.1",
79-
"@types/react": ">=17.0.21",
80-
"@types/react-dom": "^17.0.9",
75+
"@testing-library/dom": "^8.17.1",
76+
"@testing-library/jest-dom": "^5.16.5",
77+
"@testing-library/react": "^13.4.0",
78+
"@testing-library/user-event": "^14.4.3",
79+
"@types/react": "^18.0.18",
80+
"@types/react-dom": "^18.0.6",
8181
"@typescript-eslint/eslint-plugin": "^4.31.1",
8282
"babel-eslint": "^10.1.0",
8383
"babel-jest": "^27.4.6",
@@ -107,8 +107,8 @@
107107
"node-sass": "^7.0.1",
108108
"prettier": "^2.5.1",
109109
"prop-types": "^15.8.1",
110-
"react": "^17.0.2",
111-
"react-dom": "^17.0.2",
110+
"react": "^18.2.0",
111+
"react-dom": "^18.2.0",
112112
"regenerator-runtime": "^0.13.9",
113113
"replace-in-file": "^6.3.2",
114114
"sass-loader": "^12.4.0",
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
/* eslint-disable */
2-
import React, { useState } from 'react';
3-
import ReactDOM from 'react-dom';
1+
import React from 'react';
2+
import { createRoot } from 'react-dom/client';
43
import { FormRenderer } from '@data-driven-forms/react-form-renderer';
54
import 'antd/dist/antd.css';
65
import './style.css';
7-
import demoSchema from '../../../shared/demoschema';
8-
import dualListSelectSchema from './demo-schemas/dual-list-select-schema'
96
import { componentMapper, FormTemplate } from '../src';
107
import wizardSchema from './demo-schemas/wizard-schema';
11-
import sliderSchema from './demo-schemas/slider-schema';
12-
import fieldArraySchema from './demo-schemas/field-array-schema';
138

149
const style = {
1510
position: 'relative',
16-
width:'70%',
17-
margin:'auto'
18-
}
11+
width: '70%',
12+
margin: 'auto',
13+
};
1914

2015
const App = () => (
2116
<div style={style}>
2217
<FormRenderer
2318
componentMapper={componentMapper}
24-
FormTemplate={(props) => <FormTemplate layout='vertical' {...props} />}
19+
FormTemplate={(props) => <FormTemplate layout="vertical" {...props} />}
2520
onSubmit={console.log}
2621
schema={wizardSchema}
2722
/>
2823
</div>
2924
);
3025

31-
ReactDOM.render(<App />, document.getElementById('root'));
26+
const container = document.getElementById('root');
27+
const root = createRoot(container);
28+
root.render(<App />);

packages/blueprint-component-mapper/demo/index.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/* eslint-disable */
1+
/* eslint-disable no-unused-vars */
22
import React from 'react';
3-
import ReactDOM from 'react-dom';
3+
import { createRoot } from 'react-dom';
44
import FormRenderer from '@data-driven-forms/react-form-renderer/form-renderer';
55
import { arraySchemaDDF } from './demo-schemas/widget-schema';
66
import { componentMapper, FormTemplate } from '../src';
@@ -10,7 +10,7 @@ import {
1010
wizardSchemaWithFunction,
1111
wizardSchemaSimple,
1212
wizardSchemaSubsteps,
13-
wizardSchemaMoreSubsteps
13+
wizardSchemaMoreSubsteps,
1414
} from './demo-schemas/wizard-schema';
1515
import sandboxSchema from './demo-schemas/sandbox';
1616
import demoSchema from '../../../shared/demoschema';
@@ -23,9 +23,9 @@ const fieldArrayState = {
2323
additionalOptions: {
2424
initialValues: {
2525
number: [1, 2, 3, 4],
26-
minMax: [null, null, null, null]
27-
}
28-
}
26+
minMax: [null, null, null, null],
27+
},
28+
},
2929
};
3030

3131
class App extends React.Component {
@@ -51,7 +51,7 @@ class App extends React.Component {
5151
onSubmit={console.log}
5252
componentMapper={{
5353
...componentMapper,
54-
summary: Summary
54+
summary: Summary,
5555
}}
5656
FormTemplate={(props) => <FormTemplate {...props} showFormControls={this.state.additionalOptions.showFormControls} />}
5757
onCancel={console.log}
@@ -64,4 +64,6 @@ class App extends React.Component {
6464
}
6565
}
6666

67-
ReactDOM.render(<App />, document.getElementById('root'));
67+
const container = document.getElementById('root');
68+
const root = createRoot(container);
69+
root.render(<App />);

packages/carbon-component-mapper/demo/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import { FormRenderer } from '@data-driven-forms/react-form-renderer';
44
import { arraySchemaDDF } from './demo-schemas/widget-schema';
55
import { componentMapper, FormTemplate } from '../src';
@@ -14,9 +14,9 @@ const fieldArrayState = {
1414
additionalOptions: {
1515
initialValues: {
1616
number: [1, 2, 3, 4],
17-
minMax: [null, null, null, null]
18-
}
19-
}
17+
minMax: [null, null, null, null],
18+
},
19+
},
2020
};
2121

2222
class App extends React.Component {
@@ -54,4 +54,6 @@ class App extends React.Component {
5454
}
5555
}
5656

57-
ReactDOM.render(<App />, document.getElementById('root'));
57+
const container = document.getElementById('root');
58+
const root = createRoot(container);
59+
root.render(<App />);

packages/mui-component-mapper/demo/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import ReactDOM from 'react-dom';
2+
import { createRoot } from 'react-dom/client';
33
import { FormRenderer, componentTypes } from '@data-driven-forms/react-form-renderer';
44

55
import Grid from '@mui/material/Grid';
@@ -170,4 +170,6 @@ const App = () => {
170170
);
171171
};
172172

173-
ReactDOM.render(<App />, document.getElementById('root'));
173+
const container = document.getElementById('root');
174+
const root = createRoot(container);
175+
root.render(<App />);

0 commit comments

Comments
 (0)