@rhc-shared-components/alert-component
v0.2.0
Published
Alert component for Hat certified technology apps
Downloads
35
Keywords
Readme
@rhc-shared-components/alert-component
project description
Install
npm install --save @rhc-shared-components/alert-component
Usage
import React from 'react'
import { AlertComponent, AlertProvider, SuccessPopup, useAlertContext } from '@rhc-shared-components/alert-component'
const SubComponent = () => {
const {setAlertState} = useAlertContext();
return <button onClick={() => {
SuccessPopup(setAlertState, "Hello world");
}}>Show alert</button>;
}
const App = () => {
return ( <AlertProvider>
<AlertComponent/>
<SubComponent/>
</AlertProvider> )
}
export default App
License
MIT © authorGithubUsername