我尝试过禁用缓存但它不起作用 我的代码
componentDidMount = () => {
alert("hello")
}
我今天没有得到警报,其他任何东西都没有更新甚至
答案 0 :(得分:-1)
要在React Native中显示提醒,您需要使用原生Alert API
,因为不支持浏览器定义的alert
:
import { Alert } from 'react-native';
componentDidMount = () => {
Alert.alert("hello")
}
答案 1 :(得分:-2)
我试过这个
componentWillMount() {
alert("hello")
}
这有效