jsx 中的 if-else 语句:ReactJS
2022-08-30 05:23:51
我需要更改渲染功能,并在给定特定状态时运行一些子渲染功能,
例如:
render() {
return (
<View style={styles.container}>
if (this.state == 'news'){
return (
<Text>data</Text>
)
}
</View>
)
}
如何在不改变场景的情况下实现它,我将使用选项卡来动态更改内容。