I have main component in which i import smaller modal component
import QuantityModal from './QuantityModal';
// .......
return (
<SafeAreaView style={styles.container}>
<SectionList
sections={this.state.order.items}
keyExtractor={(item, index) => index}
renderItem={({item, section}) => this._renderItem(item, section)}
renderSectionHeader={({section}) => this._renderSectionHeader(section)}
/>
<View style={styles.footer}>
<Button title="Cancel" color="#c82333" onPress={this.onCancelOrderButtonClick}/>
</View>
<QuantityModal visible={this.state.quantityModalVisible}></QuantityModal>
</SafeAreaView>
)
I need to be able to open/close it and also pass some data. At first i though that i will use componentWillReceiveProps
but it suggested from console not to use it.