rescriptbr / reform

📋 Reasonably making forms sound good
https://rescript-reform.netlify.app/
MIT License
354 stars 41 forks source link

Missing Docs for Context API #191

Closed danwetherald closed 2 years ago

danwetherald commented 3 years ago

There does not seem to be an example or documentation referring to any form context as advertised in the read me.

https://github.com/Astrocoders/reform/blob/master/README.md#L165

fakenickels commented 3 years ago

That's true! Thanks for reporting.

Here goes a simple demonstration of it:

danwetherald commented 3 years ago

Would you have an example of the use of the useFormContext hook?

It feels a bit weird that it returns an optional, any best practices here?

vmarcosp commented 3 years ago

@dan003400 We're working on a new version of the documentation website. Probably we'll document the best practices for this case.

It feels a bit weird that it returns an optional, any best practices here?

@fakenickels can you explain this?

fakenickels commented 3 years ago

it's in the case you forgot to put the Provider on top of the tree. We sacrificed the usability a bit in exchange for a bit more of safety but we might revisit that as it's very annoying.

vmarcosp commented 2 years ago

@dan003400 We have a WIP PR that adds missing docs for the context. Check out #238 and https://deploy-preview-238--rescript-reform.netlify.app/docs/field please 😄

vmarcosp commented 2 years ago

@dan003400 The documentation for the context api is live: https://reform.rescriptbrasil.org/docs/use-form-context