NativeBase: Component style not update after props changed

I have gone through these following points

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)

Most upvoted comments

Please check with 2.13.3