-
-
Notifications
You must be signed in to change notification settings - Fork 700
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
Feature/Added prop for passing function when close button is clicked #1118
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
Could you please let me know if this pull request resolves the issue? |
README.md
Outdated
@@ -107,6 +107,12 @@ Support this project with your organization. Your logo will show up here with a | |||
<a href="https://opencollective.com/react-toastify/organization/8/website"><img src="https://opencollective.com/react-toastify/organization/8/avatar.svg"></a> | |||
<a href="https://opencollective.com/react-toastify/organization/9/website"><img src="https://opencollective.com/react-toastify/organization/9/avatar.svg"></a> | |||
|
|||
### ToastContainer Props |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this should be added here, the README seems to contain only high-level information about the project and not detailed release notes.
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we delete this? The project is not using package-lock.json.
yarn.lock
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert these changes? There doesn't seem to be any good reason for it.
Fixes
Summary
Added an
onButtonClose
prop to theToast
component to allow users to define a callback function that gets called when the close button of a toast is clicked. This enhancement improves the flexibility and usability of the toast component by allowing custom behavior to be executed when the close button is pressed.Changes
Toast
component to accept and handle a newonButtonClose
prop.ToastContainer
component to pass theonButtonClose
prop to eachToast
component.onButtonClose
prop.Checklist
master
.yarn
in the repository root.yarn test
).yarn start
to test changes in the playground.yarn prettier-all
).yarn lint:fix
).Additional Information
This feature allows users to pass a callback function that will be called when the toast's close button is clicked, enabling more custom and dynamic behaviors when a toast is dismissed.