Skip to content

Commit 34ba66d

Browse files
authored
Add support for React 18 (#692)
1 parent dcf6507 commit 34ba66d

File tree

4 files changed

+1741
-1832
lines changed

4 files changed

+1741
-1832
lines changed

__test_utils__/DynamicInputForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { PropsWithChildren } from 'react';
12
import * as React from 'react';
23
import Formsy from '../src';
34
import TestInput from './TestInput';
@@ -7,7 +8,7 @@ interface DynamicInputFormProps {
78
inputName?: string;
89
}
910

10-
class DynamicInputForm extends React.Component<DynamicInputFormProps, { input: any }> {
11+
class DynamicInputForm extends React.Component<PropsWithChildren<DynamicInputFormProps>, { input: any }> {
1112
constructor(props) {
1213
super(props);
1314
this.state = {

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@
4545
"prop-types": "^15.8.1"
4646
},
4747
"devDependencies": {
48-
"@testing-library/jest-dom": "^5.16.4",
49-
"@testing-library/react": "^12.1.5",
50-
"@types/jest": "^26.0.13",
51-
"@types/lodash": "^4.14.168",
52-
"@types/prop-types": "^15.7.1",
53-
"@types/react": "^17.0.0",
54-
"@types/react-dom": "^17.0.0",
48+
"@testing-library/jest-dom": "^5.16.5",
49+
"@testing-library/react": "^13.4.0",
50+
"@types/jest": "^29.2.2",
51+
"@types/lodash": "^4.14.188",
52+
"@types/prop-types": "^15.7.5",
53+
"@types/react": "^18.0.25",
54+
"@types/react-dom": "^18.0.8",
5555
"auto-changelog": "^2.4.0",
5656
"coveralls": "^3.1.1",
5757
"eslint-plugin-prettier": "^3.4.1",
5858
"husky": "^4.2.1",
5959
"np": "^5.0.0",
6060
"prettier": "^2.7.1",
61-
"react": "^16.2.0 || ^16.0.0",
62-
"react-dom": "^16.2.0 || ^16.0.0",
61+
"react": "^18.0.0",
62+
"react-dom": "^18.0.0",
6363
"tsdx": "^0.14.1",
6464
"tslib": "^2.4.0",
6565
"typescript": "^4.7.4"
6666
},
6767
"peerDependencies": {
68-
"react": "^16.0.0 || ^17.0.0",
69-
"react-dom": "^16.0.0 || ^17.0.0"
68+
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
69+
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
7070
},
7171
"standard-version": {
7272
"skip": {

src/withFormsy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export default function withFormsy<T, V>(
312312

313313
// eslint-disable-next-line react/display-name
314314
return (props) =>
315-
React.createElement(FormsyContext.Consumer, null, (contextValue) => {
315+
React.createElement(FormsyContext.Consumer, null, ((contextValue) => {
316316
return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });
317-
});
317+
}) as any);
318318
}

0 commit comments

Comments
 (0)