“reaccionar -Toastify” Código de respuesta

reaccionar Toastify NPM

$ npm install --save react-toastify
$ yarn add react-toastify
Naughty Newt

reaccionar -Toastify

import React from 'react'
import './App.css'
import { toast } from 'react-toastify'
import 'react-toastify/dist/ReactToastify.css'
toast.configure()

function App () {
  const notify = () => {
    toast('Default!', { position: toast.POSITION.TOP_LEFT })
    toast.success('Success!', {
      position: toast.POSITION.TOP_CENTER,
      autoClose: 8000
    })
    toast.info('Info!', {
      position: toast.POSITION.TOP_RIGHT,
      autoClose: false
    })
    toast.warn({
      position: toast.POSITION.BOTTOM_LEFT
    })
    toast.error('Error!', { position: toast.POSITION.BOTTOM_CENTER })
    toast('Wow so easy !', { position: toast.POSITION.BOTTOM_RIGHT })
  }
  return (
    <div className='App'>
      <button onClick={notify}>Notify !</button>
    </div>
  )
}
export default App
Abhishek

reaccionar toastify

  import React from 'react';

  import { ToastContainer, toast } from 'react-toastify';
  import 'react-toastify/dist/ReactToastify.css';
  
  function App(){
    const notify = () => toast("Wow so easy!");

    return (
      <div>
        <button onClick={notify}>Notify!</button>
        <ToastContainer />
      </div>
    );
  }
Uptight Unicorn

Respuestas similares a “reaccionar -Toastify”

Preguntas similares a “reaccionar -Toastify”

Más respuestas relacionadas con “reaccionar -Toastify” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código