Alert
NB: Experimental package!
Setup
yarn add react-with-native-alert
On react
yarn add @headlessui/react
Then, wrap your app in the AlertProvider
.
import { AlertProvider } from "react-with-native-alert";
<AlertProvider>{... your app ...}</AlertProvider>
Usage
import { useAlert } from "react-with-native-alert";
const YourPage = () => {
const alert = useAlert();
return <button onClick={() => alert("Hello")}>Click me</button>;
};
Alert
NB: Experimental package!
Setup
yarn add react-with-native-alert
On react
yarn add @headlessui/react
Then, wrap your app in the AlertProvider
.
import { AlertProvider } from "react-with-native-alert";
<AlertProvider>{... your app ...}</AlertProvider>
Usage
import { useAlert } from "react-with-native-alert";
const YourPage = () => {
const alert = useAlert();
return <button onClick={() => alert("Hello")}>Click me</button>;
};