Skip to content

Commit 58dec44

Browse files
authored
feat: Support react 18 (#607)
1 parent 1e891d0 commit 58dec44

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"prettier-stylelint": "^0.4.2",
101101
"prop-types": "^15.6.0",
102102
"raw-loader": "^0.5.1",
103-
"react": "^16.0.0",
103+
"react": "^16.3.0",
104104
"react-dom": "^16.0.0",
105105
"react-story": "^0.0.10",
106106
"rimraf": "^2.6.1",
@@ -116,7 +116,7 @@
116116
"why-did-you-update": "^0.1.1"
117117
},
118118
"peerDependencies": {
119-
"react": "^16.0.0 || ^17"
119+
"react": "^16.3.0 || ^17 || ^18"
120120
},
121121
"ava": {
122122
"files": [

src/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ class DropdownTreeSelect extends Component {
106106
}
107107
}
108108

109-
componentWillMount() {
109+
UNSAFE_componentWillMount() {
110110
this.initNewProps(this.props)
111111
}
112112

113113
componentWillUnmount() {
114114
document.removeEventListener('click', this.handleOutsideClick, false)
115115
}
116116

117-
componentWillReceiveProps(nextProps) {
117+
UNSAFE_componentWillReceiveProps(nextProps) {
118118
this.initNewProps(nextProps)
119119
}
120120

src/tree/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Tree extends Component {
3838
}
3939
}
4040

41-
componentWillReceiveProps = nextProps => {
41+
UNSAFE_componentWillReceiveProps = nextProps => {
4242
const { activeDescendant } = nextProps
4343
const hasSameActiveDescendant = activeDescendant === this.props.activeDescendant
4444
this.computeInstanceProps(nextProps, !hasSameActiveDescendant)

yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -9850,7 +9850,7 @@ react-test-renderer@^16.0.0-0:
98509850
react-is "^16.8.6"
98519851
scheduler "^0.13.6"
98529852

9853-
react@^16.0.0:
9853+
react@^16.3.0:
98549854
version "16.8.6"
98559855
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
98569856
dependencies:

0 commit comments

Comments
 (0)