Preact useState function not found after first click #1155
Unanswered
thesobercoder
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to follow the instructions from this tutorial - shadcn/ui. Created the button component from the library and started noticing the following.
The button component loses the reference to
setCount
function after the first click. Here is the error I'm getting after the first click.Here is my
import_map.json
-Here is the
button.tsx
component -Here is how I'm calling it from the
counter.tsx
component -Edit: 1
After further investigation, I found out that the main issue is with the
Slot
component from the@radix-ui/react-slot
library. If I replace theSlot
component with a standardbutton
, then everything works as expected.Any idea if this is something that can be resolved at all; otherwise I'd have to look for other libraries. Also, are there any recommended UI library to use with Fresh/Preact/Twind. The most popular component libraries are incompatible with, at least one of these technologies.
Beta Was this translation helpful? Give feedback.
All reactions