Re-render issue while performing open and setOpen using shadcn #2354
-
I have implemented a reusable dialog component using Shadcn in my todo app. However, I'm encountering an issue where the component is not working as needed. The add form and update form opens only after clicking twice. And when we click the pencil icon immediately after adding a todo it will pop add form instead of update form. I'm using zustand for state management. Dialog Component
If I set 'setIsOpen(!isOpen)' the dialog component only shows the latest todo update todo
add todo
video for better understanding Use devices with a width below 640 pixels or adjust it in the browser. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
@Akshaypmna18 let me look into that, I've got exp with Radix Ui and Shadcn UI |
Beta Was this translation helpful? Give feedback.
-
@dai-shi sorry for the trouble. I thought it was the issue of zustand |
Beta Was this translation helpful? Give feedback.
@Akshaypmna18 here you go -> Akshaypmna18/to-do#2 (the fix for the issue related to dialog showing up the latest todo)