react-native-tab-navigator icon indicating copy to clipboard operation
react-native-tab-navigator copied to clipboard

Warning:componentWillReceiveProps is deprecated

Open nameIsYong opened this issue 6 years ago • 1 comments

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 ( <View style={styles.container}> <TabNavigator style={styles.tabNav}> {this.createItem(kTitle_home, kIcon_home, kIcon_home_selected, HomeView)} {this.createItem(kTitle_mine, kIcon_mine, kIcon_mine_selected, MineView)} </TabNavigator> </View> ) } createItem(selectedTab, icon, selectedIcon, Component) { return ( <TabNavigator.Item title = {selectedTab} renderIcon = {() => <Image source={icon}/>} selected = {this.state.selectedTab === selectedTab} onPress = {() => this.setState({selectedTab:selectedTab})} > <Component/> </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" } }

"""

nameIsYong avatar Jul 24 '19 09:07 nameIsYong

this may helps: https://stackoverflow.com/questions/49258598/react-native-lifecycle-methods-warning-componentwillreceiveprops-is-deprecate

bohehe avatar Jul 29 '19 07:07 bohehe