Skip to content

CToast: Dont pass forward key prop as it's a special prop. #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jasperfirecai2 opened this issue Aug 16, 2024 · 1 comment
Closed

CToast: Dont pass forward key prop as it's a special prop. #404

jasperfirecai2 opened this issue Aug 16, 2024 · 1 comment

Comments

@jasperfirecai2
Copy link
Contributor

jasperfirecai2 commented Aug 16, 2024

If you add a key prop to CToast (e.g. mapping a list of toasts) this warning will show in the console:
key is not a prop. Trying to access it will result in undefined being returned.

As you can see CToast attempts to read and forward the key prop. This should be a differently named prop instead.

It's also not typed correctly. keys are numbers or strings


See docs
https://react.dev/warnings/special-props

@jasperfirecai2
Copy link
Contributor Author

Closed by #405

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

No branches or pull requests

1 participant