marmelab / react-admin

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design
http://marmelab.com/react-admin
MIT License
24.89k stars 5.24k forks source link

render prop on <Form> seems missing #7504

Closed gartner closed 2 years ago

gartner commented 2 years ago

When working on upgrading from V3 to V4, I came across this in the upgrade guide:

Indeed, the form displays nothing when using the render() function, but works as expected when placing the contents as childs of

This is on the v4.0.0-rc.1

andrico1234 commented 2 years ago

We noticed this behaviour as well, it looks like the new Form instead removes the need for renderProps, and the children should be rendered as regular React children. I think this may just need a documentation update?

It's a much neater pattern without the render props and required form element!

Edit: it's no substitute for documentation, but the source code provides usage examples. I hope this helps!

slax57 commented 2 years ago

Hi! Thank you for submitting this. Indeed the doc needs to be updated on this point. I'll do a PR right away to fix this. Cheers

fzaninotto commented 2 years ago

Fixed by #7505