Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
When invoking Tools.renameField, the field is renamed in MutableState, but final-form will still try to unregister with the old field name, which crashes the page with Cannot read property 'validators' of undefined.
What is the expected behavior?
final-form should unregister the renamed field name, or at least fail gracefully when trying to unsubscribe a non-existent field.
Sandbox Link
https://codesandbox.io/s/rwj3m5rlmp
What's your environment?
latest final-form, any browser
Other information
It looks like deleting field subscribers happens in the rename here, and again in the unsubscribe here, which has a reference to the old field name.
I'm happy to submit a PR for checking before deleting keys in the unsubscribe, or other fixes if there's a better way!
Are you submitting a bug report or a feature request?
Bug report
What is the current behavior?
When invoking Tools.renameField, the field is renamed in MutableState, but final-form will still try to unregister with the old field name, which crashes the page with
Cannot read property 'validators' of undefined.What is the expected behavior?
final-form should unregister the renamed field name, or at least fail gracefully when trying to unsubscribe a non-existent field.
Sandbox Link
https://codesandbox.io/s/rwj3m5rlmp
What's your environment?
latest final-form, any browser
Other information
It looks like deleting field subscribers happens in the rename here, and again in the unsubscribe here, which has a reference to the old field name.
I'm happy to submit a PR for checking before deleting keys in the unsubscribe, or other fixes if there's a better way!