From 58dec44856623b5a239013077dd0f13561cf0187 Mon Sep 17 00:00:00 2001 From: Patrick Kilgore Date: Sat, 14 Jan 2023 18:15:11 -0600 Subject: [PATCH] feat: Support react 18 (#607) --- package.json | 4 ++-- src/index.js | 4 ++-- src/tree/index.js | 2 +- yarn.lock | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index efd2f04b..9c4b139c 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "prettier-stylelint": "^0.4.2", "prop-types": "^15.6.0", "raw-loader": "^0.5.1", - "react": "^16.0.0", + "react": "^16.3.0", "react-dom": "^16.0.0", "react-story": "^0.0.10", "rimraf": "^2.6.1", @@ -116,7 +116,7 @@ "why-did-you-update": "^0.1.1" }, "peerDependencies": { - "react": "^16.0.0 || ^17" + "react": "^16.3.0 || ^17 || ^18" }, "ava": { "files": [ diff --git a/src/index.js b/src/index.js index 2944850f..2d5fd019 100644 --- a/src/index.js +++ b/src/index.js @@ -106,7 +106,7 @@ class DropdownTreeSelect extends Component { } } - componentWillMount() { + UNSAFE_componentWillMount() { this.initNewProps(this.props) } @@ -114,7 +114,7 @@ class DropdownTreeSelect extends Component { document.removeEventListener('click', this.handleOutsideClick, false) } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { this.initNewProps(nextProps) } diff --git a/src/tree/index.js b/src/tree/index.js index f9d9bf01..5ac4d56c 100644 --- a/src/tree/index.js +++ b/src/tree/index.js @@ -38,7 +38,7 @@ class Tree extends Component { } } - componentWillReceiveProps = nextProps => { + UNSAFE_componentWillReceiveProps = nextProps => { const { activeDescendant } = nextProps const hasSameActiveDescendant = activeDescendant === this.props.activeDescendant this.computeInstanceProps(nextProps, !hasSameActiveDescendant) diff --git a/yarn.lock b/yarn.lock index 649a5415..bec108c6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9850,7 +9850,7 @@ react-test-renderer@^16.0.0-0: react-is "^16.8.6" scheduler "^0.13.6" -react@^16.0.0: +react@^16.3.0: version "16.8.6" resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe" dependencies: