0.1.6 • Published 5 years ago

react-hooks-toaster v0.1.6

Weekly downloads
27
License
-
Repository
github
Last release
5 years ago

react-toaster

What is it?

It's a react library that gives your application toasts! It's heavily inspired by react-toastify but written with react hooks.

Why?

I wanted to learn react hooks

Usage

import { Toaster, ToastContext } from 'react-toaster';

Wrap your app with in the the Toaster.

    <div className="App">
      <Toaster>
        //...rest of your app
      </Toaster>
    </div>

And then anywhere in your app that's wrapped in the toaster you can import ToastContext and use it like so:

import React, { useContext } from 'react';
import ToastContext from 'react-Toaster';

const buildToast = useContext(context);
buildToast('Your logged in!');

react-toaster relies on react's new useContext hook so make sure you have react 16.8.

License

MIT

0.1.6

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago