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

set form state from on props update #9

Open
jschr opened this issue Mar 20, 2017 · 1 comment
Open

set form state from on props update #9

jschr opened this issue Mar 20, 2017 · 1 comment

Comments

@jschr
Copy link
Owner

jschr commented Mar 20, 2017

Currently createForm is only called on componentWillMount. If props change and the form's initial state depends on props it won't be updated.

Add a value prop to <FormProvider> to allow for updating the form state if props have changed. Also paves the way for improved composability.

<FormProvider form={form} value={props.user} onSubmit={saveUser}>
...
</FormProvider>
@jschr
Copy link
Owner Author

jschr commented Mar 20, 2017

This may make withForm accepting a function of props redundant.

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

1 participant