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

Fix support for function value in <Form initialValues> #5222

Merged
merged 3 commits into from
Sep 7, 2020

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Sep 2, 2020

Fixes #5221

  • Fix
  • Tests

@djhi djhi added the RFR Ready For Review label Sep 2, 2020
@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Sep 2, 2020
return {
...getValues(defaultValue, record),
...getValues(initialValues, record),
...record,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably check whether initialValues or defaultValue are functions before overriding them with the record as we pass it to them as an argument. What do you think @fzaninotto ?

@djhi djhi added RFR Ready For Review and removed WIP Work In Progress labels Sep 7, 2020
@fzaninotto fzaninotto merged commit 2a08fa3 into master Sep 7, 2020
@fzaninotto fzaninotto deleted the fix-form-initialization-from-initialvalues branch September 7, 2020 11:42
@fzaninotto fzaninotto changed the title Support function for initialValues Fix support for function value in <Form initialValues> Sep 7, 2020
@fzaninotto fzaninotto added this to the 3.8.4 milestone Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Form initialValues prop as function is not working
2 participants