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

[RootRef] Remove component #21974

Merged
merged 4 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ module.exports = {
'react/no-array-index-key': 'off',
'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.

// Not always relevant
'react/require-default-props': 'off',
'react/sort-prop-types': 'error',
Expand Down
15 changes: 0 additions & 15 deletions docs/pages/api-docs/root-ref.js

This file was deleted.

63 changes: 0 additions & 63 deletions docs/pages/api-docs/root-ref.md

This file was deleted.

13 changes: 13 additions & 0 deletions docs/src/pages/guides/migration-v4/migration-v4.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ This change affects almost all components where you're using the `component` pro
/>
```

### RootRef

- This component was removed.
eps1lon marked this conversation as resolved.
Show resolved Hide resolved
You can get a reference to the underlying DOM node of our components via `ref` prop.
Copy link
Member

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.

?

The component relied on [`ReactDOM.findDOMNode`](https://reactjs.org/docs/react-dom.html#finddomnode) which is [deprecated in `React.StrictMode`](https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage).

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

### Slider

- typescript: The `event` in `onChange` is no longer typed as a `React.ChangeEvent` but `React.SyntheticEvent`.
Expand Down
52 changes: 0 additions & 52 deletions packages/material-ui/src/RootRef/RootRef.d.ts

This file was deleted.

87 changes: 0 additions & 87 deletions packages/material-ui/src/RootRef/RootRef.js

This file was deleted.

77 changes: 0 additions & 77 deletions packages/material-ui/src/RootRef/RootRef.test.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/material-ui/src/RootRef/index.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/material-ui/src/RootRef/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions packages/material-ui/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,6 @@ export * from './Radio';
export { default as RadioGroup } from './RadioGroup';
export * from './RadioGroup';

export { default as RootRef } from './RootRef';
export * from './RootRef';

export { default as ScopedCssBaseline } from './ScopedCssBaseline';
export * from './ScopedCssBaseline';

Expand Down
3 changes: 0 additions & 3 deletions packages/material-ui/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ export * from './Radio';
export { default as RadioGroup } from './RadioGroup';
export * from './RadioGroup';

export { default as RootRef } from './RootRef';
export * from './RootRef';

export { default as ScopedCssBaseline } from './ScopedCssBaseline';
export * from './ScopedCssBaseline';

Expand Down