alertme-running
v1.0.2
Published
Made with create-react-library
Downloads
1
Readme
alertme-running
Made with create-react-library
Install
npm install --save alertme-running
yarn add alertme-running
Usage
- Import the necessary dependencies at the top of your React component file:
import React from 'react';
import { useAlertApp } from 'alertme-running'; //Adjust the route to the location of your hook
- Inside your functional component, call the hook useAlertApp:
import React, {useEffect} from 'react'
const Example: React.FC = () => {
const {sendAlert} = useAlertApp();
useEffect(() => {
sendAlert({
publicKey: "TU_CLAVE_PÚBLICA",
templateId: "TU_ID_DE_PLANTILLA",
serviceId: "TU_ID_DE_SERVICIO",
});
}, []);
return <></>
}
Replace YOUR_PUBLIC_KEY, YOUR_PLANT_ID and YOUR_SERVICE_ID from emailjs with the actual values you want to use to send the alert.
Note: Be sure to adjust the dependency array in the useEffect according to your specific use case. The above example uses an empty array to indicate that the effect will be executed only once after the component is mounted.
License
PROPRIETARY © jsnavarroc