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

usePopover error when using React 18's new render function #3958

Closed
ashleyryan opened this issue Jan 25, 2023 · 1 comment
Closed

usePopover error when using React 18's new render function #3958

ashleyryan opened this issue Jan 25, 2023 · 1 comment

Comments

@ashleyryan
Copy link

ashleyryan commented Jan 25, 2023

🐛 Bug Report

When copying the examples from usePopover on the website into an app that uses the new React 18 createRoot/render functions, the popover fails to open and instead throws an error: Cannot set properties of undefined (setting 'nodeToRestore')

The popover does open as expected with the old React 17 style ReactDOM.render function

🤔 Expected Behavior

The popover should open

😯 Current Behavior

Here's an example in stackblitz: https://stackblitz.com/edit/react-ts-ebilqa?file=index.tsx

Reproduction:

  1. Click Button
  2. Notice the error on the screen
  3. Uncomment out the old rendering in index.tsx, and comment out the react 18 style render
  4. Click the button and notice the popover opens

🔦 Context

I'm migrating from Reach-UI to react-aria because reach ui doesn't have React 18 support. I'm not using the new style render yet, but ran into the issue when I was trying to demo some basic functionality in stackblitz.

💻 Code Sample

Here's an example in stackblitz: https://stackblitz.com/edit/react-ts-ebilqa?file=index.tsx

react-aria 3.22.0

@LFDanLu
Copy link
Member

LFDanLu commented Jan 25, 2023

This will be fixed by our next release via #3878. For now you can use our latest nightly of `react-aria: https://stackblitz.com/edit/react-ts-cftyjj?file=package.json

@LFDanLu LFDanLu closed this as completed Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants