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

[InputBase] Use ref prop instead of inputRef prop on input component #23174

Merged
merged 11 commits into from
Oct 20, 2020

Conversation

GuilleDF
Copy link
Contributor

@GuilleDF GuilleDF commented Oct 20, 2020

Breaking changes

  • [TextField] Change ref forwarding expections on custom inputComponent.
    The component should forward the ref prop instead of the inputRef prop.

    -function NumberFormatCustom(props) {
    -  const { inputRef, onChange, ...other } = props;
    +const NumberFormatCustom = React.forwardRef(function NumberFormatCustom(
    +  props,
    +  ref,
    +) {
      const { onChange, ...other } = props;
    
      return (
        <NumberFormat
          {...other}
    -     getInputRef={inputRef}
    +     getInputRef={ref}

The input component was passed an inputRef prop in order to use refs with custom components. Thanks to React.forwardRef, we can change this to simply use the normal ref prop.

This resolves #22253

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín
@mui-pr-bot
Copy link

mui-pr-bot commented Oct 20, 2020

Details of bundle changes

Generated by 🚫 dangerJS against a59c686

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín
@oliviertassinari oliviertassinari added breaking change component: text field This is the name of the generic UI component, not the React module! labels Oct 20, 2020
GuilleDF and others added 2 commits October 20, 2020 11:06

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
GuilleDF Guillermo De Fermín
@GuilleDF
Copy link
Contributor Author

Hmm, not sure why the CI is failing... Any ideas? 😅

@oliviertassinari oliviertassinari merged commit afe7745 into mui:next Oct 20, 2020
@oliviertassinari oliviertassinari added this to the v5 milestone Oct 20, 2020
@oliviertassinari
Copy link
Member

@GuilleDF A flaky test. It's a great first pull request on Material-UI 👌🏻. Thank you for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Got "Does not recognize the 'inputRef' prop" warning after providing TextareaAutosize to OutlinedInput
4 participants