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

Allow decorators prop to change identity, but not array contents, without running on every render #893

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

bobbyrenwick
Copy link
Contributor

@bobbyrenwick bobbyrenwick commented Feb 4, 2021

I am running into an issue of infinite loops when upgrading from pre-hooks code to hooks based forms.

This allows you to have something like the following where the decorators will change identity on every render, without causing that decorator to be unsubscribed and re-subscribed on every render, which seems like it could be unintentional.

I'm unsure how to write a test for this but would appreciate any guidance!

const CustomForm = () => {
    return <Form decorators={[decorator1, decorator2]} />
}

Tests are failing for something unrelated? [test] Cannot find module '@babel/plugin-transform-react-jsx-source'

@bobbyrenwick bobbyrenwick changed the title Allow decorators prop to change identity, but not array contents, without running ono every render Allow decorators prop to change identity, but not array contents, without running on every render Feb 4, 2021
@erikras erikras merged commit 8389951 into final-form:main Jul 23, 2021
@erikras
Copy link
Member

erikras commented Sep 29, 2021

Published in v6.5.4.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants