# @neat-tech/react-notify

> Implementation of notify library used to display notifications. Environment: mobile, frontend.

Latest version **1.0.3** (published 2021-06-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @neat-tech/react-notify
pnpm add @neat-tech/react-notify
yarn add @neat-tech/react-notify
bun add @neat-tech/react-notify
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2021-06-17 |
| First published | 2021-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 221.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ruslana |
| Maintainers | ruslana_x, vmajsuk |

## Links

- npm: https://www.npmjs.com/package/@neat-tech/react-notify
- npm.io page: https://npm.io/package/@neat-tech/react-notify

## Recent versions

- 1.0.3 (latest) — 2021-06-17
- 1.0.2 — 2021-06-17

## README

## Neat notify

Implementation of notify library used to display notifications.
Environment: mobile, frontend.

### Installation

```bash
yarn add @neat-tech/react-notify
```

### Usage

Neat notify provides `useNotify` hook which allows to stack notifications on top of each other thanks to promise Ref.current in show function.
`notify` has `error`, `success`, `logAndError` types out of the box.

1. Basic usage:

```jsx
const logger = useLogger(); // in order to use automatic metadata logging, you must use hook from @neat/frontend to get logger

return (
  // renderItem will display notification text
  <NotificationsProvider logger={logger.error} renderItem={Snackbar}>
    <Component />
  </NotificationsProvider>
);

const Component = () => {
  const notify = useNotify();

  notify.success('Success');
};
```

2. Customize your own type with notify.show function:

```jsx
const useNotify = () => {
  const notify = useNotifyBase() // use useNotify hook form library as base
  const logger = useLogger()

  return {
    // you can create your own type and add here
    info: (text: string) => {
      logger.info(text)
      notify.show('info', text)
    },
  }
}

const notify = useNotify()

...notify.info('Info')
```

---
_Source: https://npm.io/package/@neat-tech/react-notify · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
