shakacode / re-formality

Form validation tool for reason-react
https://re-formality.now.sh
MIT License
244 stars 35 forks source link

Add enableReinitialize functionality #33

Closed baransu closed 5 years ago

baransu commented 5 years ago

Inspired by formik enableReinitialize Gives functionality to reinitialize form when initialState changes using deep equality. Useful in "edit" forms when you're loading initialState async.

alex35mil commented 5 years ago

@baransu Hey, thanks for the PR! I noticed you're using retained props api which is deprecated. Instead, you should just copy props to state manually.

I haven't looked deeper yet b/c I'm in the middle of the API overhaul and I want to ask you to hold off these changes for a bit until it's finished.

I created discussion issue and I appreciate help/feedback: https://github.com/alexfedoseev/re-formality/issues/35

baransu commented 5 years ago

I haven't noticed retainedProps are deprecated. Is there any info in the documentation about it? If you're planning the API overhaul it's totally ok to postpone or cancel this PR.

I'll try to give my feedback and help in #35 then 🙂

alex35mil commented 5 years ago

@baransu Thanks! I'm not sure why depreciation of retainedProps not in the docs but this was mentioned multiple times on Discord: https://cl.ly/204f65cb17b7 https://cl.ly/e4e8c1cfcd2d

/cc @chenglou

baransu commented 5 years ago

I think this PR is no longer relevant.