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

Warning: Cannot update a component (Title) while rendering a different component (FormSpy) #828

Open
kopax opened this issue Jul 6, 2020 · 1 comment

Comments

@kopax
Copy link

kopax commented Jul 6, 2020

Are you submitting a bug report or a feature request?

Bug

What is the current behavior?

When trying to reading the state from redux after saving it in redux, I have :

index.js:1 Warning: Cannot update a component (`Title`) while rendering a different component (`FormSpy`). To locate the bad setState() call inside `FormSpy`, follow the stack trace as described in https://fb.me/setstate-in-render
    in FormSpy (at FormStateToRedux.js:8)
    in FormStateToRedux (at CreatePromotionForm.js:308)

What is the expected behavior?

I expect no erros

Sandbox Link

Just use a component that is having

<>
 <Form>
    <FormSpy name="form" />
    <Field name="title" />
 </Form>
 <TitleFromRedux />
</>

What's your environment?

    "react": "^16.13.1",
    "react-native": "file:expo/react-native-sdk-36.0.1.tar.gz",
    "final-form": "^4.19.1",
    "final-form-arrays": "^3.0.2",
    "react-final-form": "6.5.0",
    "react-final-form-arrays": "^3.1.1",
    "react-native-final-form-material": "^1.0.14",
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

2 participants