diff --git a/docs/src/components/Sidebar/Sidebar.js b/docs/src/components/Sidebar/Sidebar.js index d8797ff909..ed63899a7a 100644 --- a/docs/src/components/Sidebar/Sidebar.js +++ b/docs/src/components/Sidebar/Sidebar.js @@ -224,7 +224,7 @@ class Sidebar extends Component { Prototypes - Migration guide to v2 + Migration guide to v3 diff --git a/docs/src/pages/MigrationGuide.mdx b/docs/src/pages/MigrationGuide.mdx index 42be594283..37810ea657 100644 --- a/docs/src/pages/MigrationGuide.mdx +++ b/docs/src/pages/MigrationGuide.mdx @@ -1,87 +1,141 @@ +import { Message } from 'semantic-ui-react' + export const meta = { - title: 'Migration Guide', + title: 'Migration Guide to v3', prevPage: { title: 'Prototypes', href: '/prototypes' }, } -This is a reference for upgrading your application to v2 of Semantic UI React. While there's a lot covered here, you probably won't need to do everything for your app. +This is a reference for upgrading your application to v3 of Semantic UI React. -## Upgrade of `react-popper` for `Popup` + + Migration guide to Semantic UI React is available here. + + } +/> -_Popper.js v1 is out of date, v2 was released in Dec 2019, time to upgrade 🚀_ +## Native ref support -### `offset` can't be specified as string anymore + -Previously it was possible to pass different units to the offset prop as units. This behavior was changed and `offset` accepts a tuple or a function. Examples in our docs were also updated. +The main change in v3 is the support of [native refs to components](https://react.dev/reference/react/forwardRef) to avoid usage of [deprecated `ReactDOM.findDOMNode()`](https://react.dev/reference/react-dom/findDOMNode). It means that `ref` prop can be used to get a reference to the underlying DOM element instead of a React component instance. -```diff - <> -- -+ -
-- -+ [-popper.width, 0]} /> - +For example, you can use `ref` to get a reference to the underlying DOM element of `Button` component: + +```jsx +import { Button } from 'semantic-ui-react' + +const App = () => { + const buttonRef = React.useRef() + + React.useEffect(() => { + console.log(buttonRef.current) + }, []) + + return