NativeBase: Component style not update after props changed
I have gone through these following points
- Check latest documentation: https://docs.nativebase.io/
- Check for existing open/closed issues for a possible duplicate before creating a new issue: https://github.com/GeekyAnts/NativeBase/issues
- Use the latest NativeBase release: https://github.com/GeekyAnts/NativeBase/releases
- Check examples from NativeBase KitchenSink https://github.com/GeekyAnts/NativeBase-KitchenSink
- For discussion purpose make use of NativeBase Slack: http://slack.nativebase.io/
- For queries related to theme, check Theme Variables from Docs and live NativeBase Theme Editor http://nativebase.io/customizer/
Issue Description
node, npm, react-native, react and native-base version, expo version if used, xcode version
react-native:0.59.10 react: 16.8.6 native-base: 2.13.0
Expected behaviour
The component style change after props change
Actual behaviour
The component style stays in the initial style
Steps to reproduce
`class TwoStateButton extends Component { constructor(props) { super(props); this.state = { isChecked: props.initialChecked }; }
render() { const {isChecked} = this.state;
return (
<Button ghost={isChecked} active onPress={() => this.setState({isChecked: !isChecked})}>
<Text style={{color: isChecked ? 'green' : 'red'}}>{isChecked ? 'checked' : 'not'}</Text>
</Button>
);
} }`
Is the bug present in both iOS and Android or in any one of them?
both
Any other additional info which would help us debug the issue quicker.
In the native-base dependancy we have
“native-base-shoutem-theme”: “github:GeekyAnts/theme#master”.
At the 23.7 someones commit to the GeekyAnts/theme#master commit
he replaced the componentWillRecivedProps to componentcomponentDidUpdate.
This broke the updating of native base component.
relay on the master branch in dependency is super dangerous.
Thanks for this amazing package
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 15 (4 by maintainers)
Please check with 2.13.3