Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including izitoast-react with all npm packages installed. Try it out:

require("react/package.json"); // react is a peer dependency. var izitoastReact = require("izitoast-react")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

izitoast-react v1.0.16

A wrapper for izitoast by @marcelodolza

izitoast-react

A react wrapper for izitoast with react hooks

NPM JavaScript Style Guide

Install

npm install --save izitoast-react

Usage

import * as React from 'react'

import { useToast, immediateToast } from 'izitoast-react'

const App = () => {
  const showMessage = useToast({
    message: 'Show my message :)',
  });

  useEffect(() => {
    immediateToast('info', {
      message: 'Hi, how it is going'
    })
  });


  return (
    <div>
      <button onClick={showMessage} >Show</button>
    </div>
  )
};

Demo : CodeSandbox

License

React wrapper sayjeyhi Apache-2.0 © marcelodolza


This hook is created using create-react-hook.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free