alert for both android and IOS in react-native
<p>Hai i am trying to show alert message, i tried different ways like alert,AlertIOS,Alert.alert</p>

<ul>
<li>AlertIOS is working in IPhone but not working in android and alert also same
In Docs i saw that Alert.alert will work for both Android an IOS,But i got an error like undefined is not an object(evaluating 'Alert.alert')
I wrote like this:</li>
</ul>

<blockquote>
<pre><code>Alert.alert('Alert', 'email is not valid, Please enter correct email', [{text: 'Ok'}]);
</code></pre>
</blockquote>

<p>I got an error like this:</p>

<p><a href="https://i.stack.imgur.com/Gzi3H.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Gzi3H.png" alt="enter image description here"></a></p>

<p>Any one give suggestions that how to show the alert in Android and IOS in react-native
Any help much appreciated</p>