eui icon indicating copy to clipboard operation
eui copied to clipboard

Popover and ContextMenu do not support react 18

Open botlikes456 opened this issue 3 years ago • 4 comments

Hi, I'm using react 18.1.0, and found that popover and context menu cannot show at react 18. when I back to react 17.0.2, it works.

botlikes456 avatar May 02 '22 08:05 botlikes456

Related to #5774. We don't have a timeline yet for enabling support for React 18.

thompsongl avatar May 02 '22 14:05 thompsongl

Related to #5774. We don't have a timeline yet for enabling support for React 18.

Got, thanks. Guess it is led by portal?

botlikes456 avatar May 03 '22 05:05 botlikes456

At least with Next and React 18 I found that having strict mode enabled is what prevents popovers, tooltips, menus, etc. from showing.

zerosym avatar May 10 '22 02:05 zerosym

From the official documentation of React:

If your app doesn’t work after upgrading, check whether it’s wrapped in <StrictMode>. Strict Mode has gotten stricter in React 18, and not all your components may be resilient to the new checks it adds in development mode. If removing Strict Mode fixes your app, you can remove it during the upgrade, and then add it back (either at the top or for a part of the tree) after you fix the issues that it’s pointing out.

ycanardeau avatar Jul 06 '22 08:07 ycanardeau

Confirmed that the components mentioned have issues in React 18 projects with StrictMode. Many of them have (less apparent) issues with StrictMode in React 17, but there's something in 18 that makes them completely fall over (we should fix the issues with 17, too). I'm going to create new issues for each of these components for better tracking, and close this one.

chandlerprall avatar Aug 25 '22 20:08 chandlerprall