react-toastify icon indicating copy to clipboard operation
react-toastify copied to clipboard

Syntax Error or a Bug in documentation

Open arnavnagpurkar opened this issue 1 year ago • 2 comments

Bug

What is the current behavior In the website https://fkhadra.github.io/react-toastify/introduction/ The "Toast Container" has a bug. image in the <ToastContainer/> there is a attribute transition where : semicolon is added instead of = equal too sign. When we assign value to attributes we need to insert = sign instead of : semicolons as in JSON. And the value Bounce must also be enclosed in the quotes or double quotes. If user will copy from this documentation then he'll face errors.

expected behaviour User should not face error. We need to updated it in the documentation to:

<ToastContainer
  position="top-right"
  autoClose={5000}
  hideProgressBar={false}
  newestOnTop={false}
  closeOnClick
  rtl={false}
  pauseOnFocusLoss
  draggable
  pauseOnHover
  theme="light"
  transition="Bounce",
/>

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? This issue is applicable to all versions of react and next.js

arnavnagpurkar avatar Mar 24 '24 07:03 arnavnagpurkar

I believe is should be:

import { ToastContainer, Bounce } from 'react-toastify';

<ToastContainer
position="top-right"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
theme="light"
transition={Bounce}
/>
{/* Same as */}
<ToastContainer />

transition needs a ToastTransition | undefined

cjboco avatar May 15 '24 23:05 cjboco

I agree, it's a bug.

ethubert avatar Jul 18 '24 11:07 ethubert