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

useOnSubmit hook for Create/ EditGuessers #542

Merged
merged 4 commits into from
Apr 5, 2024

Conversation

PawelSuwinski
Copy link
Contributor

Refactored form submit handler and moved to stand alone hook. It makes easier to write custom form components with introspection without copy/ paste of save callback code from Guessers components.

See #540.

@PawelSuwinski PawelSuwinski changed the title useOnSubmit hook for Create/ EditGuesser useOnSubmit hook for form components with introspection/ refactored Create/ EditGuessers Mar 28, 2024
@PawelSuwinski PawelSuwinski changed the title useOnSubmit hook for form components with introspection/ refactored Create/ EditGuessers useOnSubmit hook for Create/ EditGuessers Mar 28, 2024
@fzaninotto
Copy link
Contributor

This does indeed look like a progress in comparison with the previous version.

However, I still think that you should package the logic into a component that developers can paste and then modify. If you follow the react-admin conventions, the Guesser should just just render a series of components and paste them to the console so that the developer can customize them. It seems that part of the logic you've put in the guessers should be in some specific HydraEdit, HydraCreate and HydraList components.

But I understand it's not the purpose of this PR, so LGTM.

@PawelSuwinski PawelSuwinski merged commit 1d4e833 into api-platform:main Apr 5, 2024
3 checks passed
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.

2 participants