0.1.6 • Published 1 year ago

@rhc-shared-components/alert-component v0.1.6

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
1 year ago

@rhc-shared-components/alert-component

project description

NPM JavaScript Style Guide

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

0.1.6

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago