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

Replace deprecated react-popper with floating-ui #2325

Closed
2 tasks done
mimarz opened this issue Jun 20, 2022 · 3 comments
Closed
2 tasks done

Replace deprecated react-popper with floating-ui #2325

mimarz opened this issue Jun 20, 2022 · 3 comments
Assignees
Labels
core-react eds-core-react epic lab-react eds-lab-react 🔨 technical Technical debt and similar

Comments

@mimarz
Copy link
Contributor

mimarz commented Jun 20, 2022

Popperjs (along with react-popper) has evolved to floating-ui and is now deprecated/maintenance-mode as further development is done on floating-ui.

Relevant blog post: https://blog.logrocket.com/popper-vs-floating-ui/

Actions

  • Figure out best way to update to use floating-ui
    • Do we still use our wrapper hook or use it directly in our components?
  • Replace popperjs & react-popper with floating-ui

Edit:

Based on some light testing and looking at documentation for floating-ui it looks like its best to use it directly in each component now instead of via our wrapper hook. This is due to the new api for the library being more composable and doing much more than older versions.

At first glance, middleware in floating-ui now has features that replaces our need for useIsMounted, useOutsideClick and useHideBodyScroll hooks.

Codesandbox examples using new floating-ui

@mimarz mimarz added core-react eds-core-react 🔨 technical Technical debt and similar lab-react eds-lab-react labels Jun 20, 2022
@mimarz mimarz self-assigned this Jun 22, 2022
@mimarz
Copy link
Contributor Author

mimarz commented Jun 23, 2022

After having a look at floating-ui and how its used it differs quite a lot from react-popper (in a good way).

Elevating this to an epic as we need to do the conversion for each step by step for component using usePopper separately.

Updating description with detailed information.

@mimarz mimarz added the epic label Jun 23, 2022
@mimarz
Copy link
Contributor Author

mimarz commented Jun 23, 2022

In short term we will upgrade existing react-popper to latest as it should fix some errors people have been having when using React 18. #2341

@mimarz mimarz changed the title Replace deprecated react-popper Replace deprecated react-popper with floating-ui Jun 23, 2022
@mimarz
Copy link
Contributor Author

mimarz commented Sep 8, 2022

Solved in #2464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-react eds-core-react epic lab-react eds-lab-react 🔨 technical Technical debt and similar
Projects
None yet
Development

No branches or pull requests

1 participant