You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Dialog with useState. My code is like this
'use client';exportfunctionDialogCloseButton(){const[open,setOpen]=useState(true);return(<Dialogopen={open}onOpenChange={setOpen}><DialogContentclassName="sm:max-w-md"><DialogHeader><DialogTitle>Share link</DialogTitle><DialogDescription>
Anyone who has this link will be able to view this.
</DialogDescription></DialogHeader><divclassName="flex items-center space-x-2"><divclassName="grid flex-1 gap-2"><LabelhtmlFor="link"className="sr-only">
Link
</Label><Inputid="link"defaultValue="https://ui.shadcn.com/docs/installation"readOnly/></div></div></DialogContent></Dialog>);}
I get error like this Error: Hydration failed because the initial UI does not match what was rendered on the server. Warning: Expected server HTML to contain a matching <div> in <div>.
Any way to resolve this issue?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using Dialog with useState. My code is like this
I get error like this
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Warning: Expected server HTML to contain a matching <div> in <div>.
Any way to resolve this issue?
Beta Was this translation helpful? Give feedback.
All reactions