Skip to content
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

Fix form helper transform return type in React adapter #1896

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

rejin-r
Copy link
Contributor

@rejin-r rejin-r commented Jun 14, 2024

Simple fix for a wrong type for the transform function in the react package.

@@ -18,7 +18,7 @@ export interface InertiaFormProps<TForm extends FormDataType> {
wasSuccessful: boolean
recentlySuccessful: boolean
setData: setDataByObject<TForm> & setDataByMethod<TForm> & setDataByKeyValuePair<TForm>
transform: (callback: (data: TForm) => TForm) => void
transform: (callback: (data: TForm) => object) => void
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return value cannot be of type TForm as that defeats the purpose of transform. It should be anything but TForm. 😄

@reinink reinink merged commit 331793a into inertiajs:master Jun 17, 2024
5 checks passed
@reinink reinink changed the title [React] Fix wrong type in transform Fix form helper transform return type in React adapter Jun 17, 2024
@reinink
Copy link
Member

reinink commented Jun 17, 2024

Thanks! 🙏

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.

None yet

3 participants