React-toastify: Add Title Field to toast

Created on 26 Sep 2018  路  2Comments  路  Source: fkhadra/react-toastify

Hi This is a feature request, Can you please allow for toast title parameter to be added to this package? Thanks

Most helpful comment

Thanks @fkhadra. I later found this in the doc. Didn't know it had been updated. Been a while since I used it

All 2 comments

Hey @kenshinman,

You can pass a react component, more detail here.

import React from 'react';
import { ToastContainer, toast } from "react-toastify";

const Msg = ({ closeToast }) => (
  <div>
   <h2> My title</h2>
   <p> Some test </p>
  </div>
)

const App = () => (
  <div>
    <button onClick={() => toast(<Msg />)}>notify</button>
    <ToastContainer />
  </div>
);

Thanks @fkhadra. I later found this in the doc. Didn't know it had been updated. Been a while since I used it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LouisCuvelier picture LouisCuvelier  路  3Comments

billtlee picture billtlee  路  5Comments

NoMercy235 picture NoMercy235  路  5Comments

JaLe29 picture JaLe29  路  5Comments

giocodes picture giocodes  路  3Comments