Skip to content

[RootRef] Remove component#21974

Merged
eps1lon merged 4 commits intomui:nextfrom
eps1lon:feat/RootRef/remove
Jul 29, 2020
Merged

[RootRef] Remove component#21974
eps1lon merged 4 commits intomui:nextfrom
eps1lon:feat/RootRef/remove

Conversation

@eps1lon
Copy link
Member

@eps1lon eps1lon commented Jul 28, 2020

Breaking change

  • This component was removed. You can get a reference to the underlying DOM node of our components via ref prop.
    The component relied on ReactDOM.findDOMNode which is deprecated in React.StrictMode.

    -<RootRef rootRef={ref}>
    -  <Button />
    -</RootRef>
    +<Button ref={ref} />

RootRef is no longer needed for our components nor used internally. If people still need this component they can copy the old source.

Follow-up:

  • add deprecation warning

@eps1lon eps1lon added breaking change Introduces changes that are not backward compatible. package: core labels Jul 28, 2020
@eps1lon eps1lon added this to the v5 milestone Jul 28, 2020
@mui-pr-bot
Copy link

mui-pr-bot commented Jul 28, 2020

@material-ui/core: parsed: -0.47% 😍, gzip: -0.60% 😍
@material-ui/lab: parsed: -0.00% 😍, gzip: +0.30%

Details of bundle changes

Generated by 🚫 dangerJS against 4e1be3a

### RootRef

- This component was removed.
You can get a reference to the underlying DOM node of our components via `ref` prop.
Copy link
Collaborator

Choose a reason for hiding this comment

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

via the ref prop?

Copy link
Member Author

Choose a reason for hiding this comment

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

You mean

Suggested change
You can get a reference to the underlying DOM node of our components via `ref` prop.
You can get a reference to the underlying DOM node of our components via the `ref` prop.

?

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 28, 2020
Co-authored-by: Olivier Tassinari <olivier.tassinari@gmail.com>
@eps1lon eps1lon removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Jul 29, 2020
@eps1lon eps1lon requested a review from oliviertassinari July 29, 2020 17:15
'react/no-danger': 'error',
'react/no-direct-mutation-state': 'error',
// Required for backward compatibility. TODO v5, drop
'react/no-find-dom-node': 'off',
Copy link
Member

Choose a reason for hiding this comment

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

Cool, I have created a note to remove that rule from the material-ui-x repository.

@eps1lon eps1lon merged commit 64de0cd into mui:next Jul 29, 2020
@eps1lon eps1lon deleted the feat/RootRef/remove branch July 29, 2020 18:38
oliviertassinari added a commit to oliviertassinari/mui-x that referenced this pull request Aug 1, 2020
oliviertassinari added a commit to oliviertassinari/mui-x that referenced this pull request Aug 1, 2020
oliviertassinari added a commit to oliviertassinari/mui-x that referenced this pull request Aug 2, 2020
oliviertassinari added a commit to oliviertassinari/mui-x that referenced this pull request Aug 2, 2020
@eps1lon eps1lon mentioned this pull request Aug 5, 2020
42 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Introduces changes that are not backward compatible.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants