-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat: added setAction feature #6451 #6487
feat: added setAction feature #6451 #6487
Conversation
🦋 Changeset detectedLatest commit: 5748268 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Hey @AYUSHKUMARGUPTA thanks for the PR!
Could you add tests to make sure new behaviour works as expected and update documentation so people will be aware of this feature?
@BatuhanW Sure will get this updated |
It would be better to add a metadata prop to the show method this way any data can be passed down... |
Updating test case Updating meta data prop
Updated the test cases and metadata prop |
Updated the code for build failure. |
Thank you for the PR @AYUSHKUMARGUPTA, I've just left a comment to the issue #6451 (comment) and tried to explain the missing steps in the implementation of this feature. For now, we've decided to keep this feature on hold and include it in our next release roadmap. 🙏 |
PR Checklist
Please check if your PR fulfills the following requirements:
Bugs / Features
What is the current behavior?
What is the new behavior?
fixes (issue)
Notes for reviewers
Added setAction function to get action dynamically
Usage
`const { setAction, show, modalProps } = useModalForm({
action: "create",
});
// Call setAction to change the action type
const handleEdit = () => {
setAction("edit");
show();
};
const handleCreate = () => {
setAction("create");
show();
};`