Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138249

How to properly use external modal in ReactNative?

$
0
0

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.


Viewing all articles
Browse latest Browse all 138249

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>