refinedev / refine

A React Framework for building internal tools, admin panels, dashboards & B2B apps with unmatched flexibility.
https://refine.dev
MIT License
28.6k stars 2.24k forks source link

feat: added setAction feature #6451 #6487

Open AYUSHKUMARGUPTA opened 1 week ago

AYUSHKUMARGUPTA commented 1 week ago

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(); };`

changeset-bot[bot] commented 1 week ago

🦋 Changeset detected

Latest commit: 5748268aad4909de7a572d6588900e64ab48fce9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages | Name | Type | | ------------------------ | ----- | | @refinedev/antd | Major | | @refinedev/inferencer | Major | | @refinedev/live-previews | Patch |

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

AYUSHKUMARGUPTA commented 1 week ago

@BatuhanW Sure will get this updated

aress31 commented 6 days ago

It would be better to add a metadata prop to the show method this way any data can be passed down...

AYUSHKUMARGUPTA commented 5 days ago

Updated the test cases and metadata prop

AYUSHKUMARGUPTA commented 2 days ago

Updated the code for build failure.