Skip to content

Conversation

sagarpaul9475
Copy link

What this does

Adds a developer warning when a string (e.g., "Bounce") is passed to the transition prop of ToastContainer.

Why

The transition prop expects a transition component (like transition={Bounce}), but beginners may accidentally pass a string like "Bounce", which fails silently. This warning will improve developer experience.

Example

// ❌ This will trigger a warning
<ToastContainer transition="Bounce" />

// ✅ This is correct
import { Bounce } from 'react-toastify';
<ToastContainer transition={Bounce} />

@Link2Twenty
Copy link

Typescript will already catch this for you.

You'll get the error

Type 'string' is not assignable to type 'ToastTransition | undefined'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants