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

Ensure form children can override props #5895

Merged
merged 2 commits into from Feb 19, 2021

Conversation

djhi
Copy link
Contributor

@djhi djhi commented Feb 10, 2021

This can be useful when you want to display a component using a different resource in the form.

  • Implementation
  • Example use case

@djhi djhi added the RFR Ready For Review label Feb 10, 2021
@fzaninotto
Copy link
Member

Can you add a use case?

const { id, ...inputProps } = input ? input.props : { id: undefined };
const { id, className, ...inputProps } = input
? input.props
: { id: undefined, className: undefined };
Copy link
Contributor

Choose a reason for hiding this comment

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

Using an empty object will do the trick. No need to assign "undefined" since things are already "undefined" in the empty object

Copy link
Contributor Author

@djhi djhi Feb 15, 2021

Choose a reason for hiding this comment

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

TypeScript disagrees

@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Feb 15, 2021
@fzaninotto fzaninotto merged commit 9fdc764 into master Feb 19, 2021
@fzaninotto fzaninotto deleted the ensure-form-children-can-override-props branch February 19, 2021 21:00
@fzaninotto fzaninotto added this to the 3.12.5 milestone Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants