Skip to content

Commit

Permalink
Add support for React 18 (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixmosh authored Nov 8, 2022
1 parent dcf6507 commit 34ba66d
Show file tree
Hide file tree
Showing 4 changed files with 1,741 additions and 1,832 deletions.
3 changes: 2 additions & 1 deletion __test_utils__/DynamicInputForm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { PropsWithChildren } from 'react';
import * as React from 'react';
import Formsy from '../src';
import TestInput from './TestInput';
Expand All @@ -7,7 +8,7 @@ interface DynamicInputFormProps {
inputName?: string;
}

class DynamicInputForm extends React.Component<DynamicInputFormProps, { input: any }> {
class DynamicInputForm extends React.Component<PropsWithChildren<DynamicInputFormProps>, { input: any }> {
constructor(props) {
super(props);
this.state = {
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,28 @@
"prop-types": "^15.8.1"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^12.1.5",
"@types/jest": "^26.0.13",
"@types/lodash": "^4.14.168",
"@types/prop-types": "^15.7.1",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@types/jest": "^29.2.2",
"@types/lodash": "^4.14.188",
"@types/prop-types": "^15.7.5",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.8",
"auto-changelog": "^2.4.0",
"coveralls": "^3.1.1",
"eslint-plugin-prettier": "^3.4.1",
"husky": "^4.2.1",
"np": "^5.0.0",
"prettier": "^2.7.1",
"react": "^16.2.0 || ^16.0.0",
"react-dom": "^16.2.0 || ^16.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"tsdx": "^0.14.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4"
},
"peerDependencies": {
"react": "^16.0.0 || ^17.0.0",
"react-dom": "^16.0.0 || ^17.0.0"
"react": "^16.0.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
},
"standard-version": {
"skip": {
Expand Down
4 changes: 2 additions & 2 deletions src/withFormsy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ export default function withFormsy<T, V>(

// eslint-disable-next-line react/display-name
return (props) =>
React.createElement(FormsyContext.Consumer, null, (contextValue) => {
React.createElement(FormsyContext.Consumer, null, ((contextValue) => {
return React.createElement(WithFormsyWrapper, { ...props, ...contextValue });
});
}) as any);
}
Loading

0 comments on commit 34ba66d

Please sign in to comment.