Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning:componentWillReceiveProps is deprecated #194

Open
nameIsYong opened this issue Jul 24, 2019 · 1 comment
Open

Warning:componentWillReceiveProps is deprecated #194

nameIsYong opened this issue Jul 24, 2019 · 1 comment

Comments

@nameIsYong
Copy link

Warning:componentWillReceiveProps is deprecated and will be removed in the next major version. Use static getDerivedStateFromProps instead.
Please update the following components:TabNavigator

$ npm info react-native-tab-navigator
[email protected] | MIT | deps: 2 | versions: 24

"""
import TabNavigator from "react-native-tab-navigator";
...
render () {
return (


{this.createItem(kTitle_home, kIcon_home, kIcon_home_selected, HomeView)}
{this.createItem(kTitle_mine, kIcon_mine, kIcon_mine_selected, MineView)}


)
}
createItem(selectedTab, icon, selectedIcon, Component) {
return (
<TabNavigator.Item
title = {selectedTab}
renderIcon = {() => }
selected = {this.state.selectedTab === selectedTab}
onPress = {() => this.setState({selectedTab:selectedTab})}
>

</TabNavigator.Item>
)
}
"""

"""
{
"name": "Demo",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.4",
"react-native-tab-navigator": "^0.3.4",
"react-navigation": "^3.11.1"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"eslint": "^6.1.0",
"jest": "^24.8.0",
"metro-react-native-babel-preset": "^0.55.0",
"react-test-renderer": "16.8.6"
},
"jest": {
"preset": "react-native"
}
}

"""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants