-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Radix UI / Select component in preact #4222
Comments
This appears to be due to the fact that React delays invoking unmount effects until commit phase, whereas Preact invokes unmount effects synchronously. Interestingly, radix-ui's Select unmounts, then remounts all of the Select's children upon opening the Select: https:/radix-ui/primitives/blob/c31c97274ff357aea99afe6c01c1c8c58b6356e0/packages/react/select/src/Select.tsx#L407-L421 Seems like that'd be not great for performance. I'd expect just a mount of all the select children upon opening. This Upon unmounting Select's children, this effect is cleaned up and the Sorry I don't have a workaround or fix at the moment, but just wanted to leave some notes here for posterity in case I or someone else picks this up again. |
Describe the bug
I try to port Radix UI to preact & Fresh
See :
Every components work except Select which freeze the page (getItems has no element => error)
To Reproduce
The code with React
https://codesandbox.io/p/sandbox/select-radixui-react-klhjfn
The code with Preact : I have only change
React.forwardRef
toimport { forwardRef } from "preact/compat";
In Fresh, I made alias/external to react
The repo to test
https:/hapaxlife/select-radixui-preact
Expected behavior
When you click on Select, the page freezes.
I suspect that error comes from Preact but not sure if Fresh is involve
The text was updated successfully, but these errors were encountered: