class A extends React.Component {
componentWillReceiveProps() {
this.props.alert.show('this ends up creating infinite loop')
}
render() {
this.props.alert.show('this ends up creating infinite loop')
}
}
I am trying to send error alert when props are incorrect, but for some reason alert.show is triggering re-render and componentsWillReceiveProps method. What approach should I take here, All examples show how to use an alert on Button click, not very useful in real-life scenarios.
I am trying to send error alert when props are incorrect, but for some reason alert.show is triggering re-render and componentsWillReceiveProps method. What approach should I take here, All examples show how to use an alert on Button click, not very useful in real-life scenarios.