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

Add renderForm prop to Form #122

Open
danielweinmann opened this issue Dec 7, 2022 · 3 comments
Open

Add renderForm prop to Form #122

danielweinmann opened this issue Dec 7, 2022 · 3 comments

Comments

@danielweinmann
Copy link
Contributor

danielweinmann commented Dec 7, 2022

The renderForm function would receive the same arguments as children + Form (which would be the value of component prop passed either to the form or to createForm) + fetcher (which would be the value of the fetcher prop).

It would be called whenever there are no children passed to the form, just like renderField is called when there are no children passed to Field.

That would allow us to customize the default markup of the forms, including custom pending UI like the one described in #37.

@gustavoguichard
Copy link
Contributor

Wouldn't renderForm be a better name then?
I think it'd be clearer

@danielweinmann
Copy link
Contributor Author

Maybe. It felt redundant to me since it will be the render prop of Form. But maybe redundancy is good in this case :)

@diogob
Copy link
Contributor

diogob commented Dec 7, 2022

I think we should start investigating a generic API for markup customization, that would preclude adding props every time we want to customize some new element. Perhaps exposing mapper functions that could be composed and passed around or set as part of the default form?

@danielweinmann danielweinmann changed the title And render prop to Form Add renderForm prop to Form Mar 25, 2023
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

No branches or pull requests

3 participants