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 message in console when using the field validation for a string field. #1016

Closed
nipothar opened this issue Dec 8, 2022 · 3 comments

Comments

@nipothar
Copy link

nipothar commented Dec 8, 2022

Bug report

What is the current behavior?

I have a field of type string, and when I add any validate method this is the warning message that shows up in console:

Warning: Cannot update during an existing state transition (such as within render). Render methods should be a pure function of props and state.

This occurs in the ForwardRef(Field). Full stacktrace shown below.

What is the expected behavior?

No console warning.

Sandbox Link

Not able to reproduce this.

What's your environment?

final-form: 4.20.7, Typescript, React application.

Other information

Warning: Cannot update during an existing state transition (such as within render). Render methods should be a pure function of props and state.
in ForwardRef(Field) (created by ScheduleStopTimeField)
in ScheduleStopTimeField (created by ScheduleFormFields)
in div (created by StackItem)
in StackItem (created by InternalFormLabel)
in div (created by Stack)
in Stack (created by InternalFormLabel)
in div (created by StackItem)
in StackItem (created by InternalFormLabel)
in div (created by Stack)
in Stack (created by InternalFormLabel)
in InternalFormLabel (created by RealFormLabel)
in RealFormLabel (created by RealFormLabel)
in ErrorBoundary (created by RealFormLabel)
in RealFormLabel (created by ScheduleFormFields)
in div (created by StackItem)
in StackItem (created by ScheduleFormFields)
in div (created by Stack)
in Stack (created by ScheduleFormFields)
in ScheduleFormFields (created by ReactFinalForm)
in div (created by Stack)
in Stack (created by ReactFinalForm)
in ReactFinalForm (created by CreateOrUpdatePoolForm)
in CreateOrUpdatePoolForm (created by UpdatePoolBladeInjected)
in UpdatePoolBladeInjected (created by ConnectFunction)
in ConnectFunction (created by UpdatePoolReactView)
in Provider (created by UpdatePoolReactView)
in ErrorBoundary (created by UpdatePoolReactView)
in UpdatePoolReactView
in Customizer (created by ThemedFabric)
in div (created by ThemeProvider)
in ThemeProvider (created by ThemedFabric)
in ThemedFabric

@nipothar
Copy link
Author

nipothar commented Dec 12, 2022

Bumping this issue, can someone help take a look at this? We are unable to have field validation for string type fields.

@gertdreyer
Copy link
Collaborator

gertdreyer commented Jan 11, 2023

@nipothar Did you perhaps use State Hooks or redux inside one of your child components or validator?

@gertdreyer
Copy link
Collaborator

Closing due to no activity - please feel free to reopen if the issue persists

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

No branches or pull requests

2 participants