-1

i have tried disabling cache but it does not work my Code

componentDidMount = () => {


  alert("hello")


  }

i dont get the alert today anything else is not updating even

suman j
  • 6,710
  • 11
  • 58
  • 109
Prince Hamza
  • 1,090
  • 12
  • 21

2 Answers2

-1

For displaying alerts in React Native, you need to use the native Alert API, as the browser-defined alert is not supported:

import { Alert } from 'react-native';

componentDidMount = () => {
    Alert.alert("hello")
}
otorrillas
  • 4,357
  • 1
  • 21
  • 34
-2

I tried this

 componentWillMount() {
       
       alert("hello")
   }

and this worked

Eshan I.
  • 75
  • 1
  • 10