0
私のレンダー機能では、ロードを行う際に 'loading'が表示されますので、私は 'setState'を呼び出してDOMを再レンダリングします。私はモーダルを表示したいが、モーダルは表示されない。どうした俺?Dom再レンダリング時にReact-Native Modalが表示されない
render: function() {
if (!this.props.data) {
return (<View style={{flex:1}}>
<Text>loading</Text>
</View>);
}
return (
<View style={{flex:1, width:screenWidth}}>
<Modal
visible={true}
transparent={true}
onRequestClose={()=>{
}}
onShow={()=>{
}}>
<View
style={{flex:1,justifyContent:'center',alignItems:'center',backgroundColor:'rgba(0, 0, 0, 0.3)'}}>
<View style={{height:200,width:275,backgroundColor:'white'}}>
<Button title='confirm' onPress={()=>{}}/>
<Button title='cancel' onPress={()=>{}}/>
</View>
</View>
</Modal>
</View>
);
}
@エリックは固定されていますか? –
「予期しないトークン」というエラーが発生しました。たぶん '?:'はリターン関数で使うことができないでしょうか? – Eric
あなたはそのコードを表示していただけますか? –