notify-component
TypeScript icon, indicating that this package has built-in type declarations

1.2.14 • Public • Published

#Usage

###define in router

import {NotifyContainer} from "notify-component";

return(<ErrorBoundary>
    <Routes>
      <Route element={<>
        <HeaderLanding/>
        <Layout/>
      </>}>
        <Route path="/agreement" element={<MainPage/>}/>
        <Route path="/policy" element={<MainPage/>}/>
        <Route path="/" element={<MainPage/>}/>
        <Route path="/login" element={<Forbidden/>}/>
        <Route path='*' element={<NotFound/>} />
      </Route>
    </Routes>
    <NotifyContainer/> <----- here
</ErrorBoundary>);
}

###Use it anywhere

NotifyManager.info('Success header', 'Success text')
NotifyManager.error('Error header', 'Error text')

###Uploading file

let id = NotifyManager.id();//it creats unique id
NotifyManager.once(id, '', 'Upload text', 'waiting', 99999999999)//it waits forever

NotifyManager.delete(id);//it deletes a loader

Readme

Keywords

none

Package Sidebar

Install

npm i notify-component

Weekly Downloads

305

Version

1.2.14

License

MIT

Unpacked Size

73 kB

Total Files

66

Last publish

Collaborators

  • olegstan