-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[RFR] SimpleForm/TabbedForm - deprecate defaultValue #3636
Conversation
|
||
### Per Input Default Value | ||
|
||
Alternatively, you can specify a `defaultValue` prop directly in `<Input>` components. Just like for form-level default values, an input-level default value can be a scalar, or a function returning a scalar. React-admin will merge the input default values with the form default value (input > form): | ||
Alternatively, you can specify a `defaultValue` prop directly in `<Input>` components. Default value can be a scalar, or a function returning a scalar. React-admin will merge the input default values with the form default value (input > form): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that both defaultValue
and initialValue
are supported: https://final-form.org/docs/react-final-form/types/FieldProps#defaultvalue & https://final-form.org/docs/react-final-form/types/FieldProps#initialvalue.
Probably worth to mention that users should read final-form documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initialValue on input does not work either in SImpleForm or Tabbed Form
it would probably need extra some changes for it to be passed to final-form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about what to do about the defaultValue
function support. Should we add it back as initialValues
too ?
Otherwise, we would have to add an example about how to migrate from it by wrapping SimpleForm
and TabbedForm
to see the record
and build the initial values from it
fixed and repushed |
and add initialValues to proptypes
I had to rebase it and wasn't able to do it on your fork. Closed in favor of #3756. |
and add initialValues to proptypes
fixes #3627