Hydration error when using `useId()`
Unanswered
Mudi posted this in #help-forum
MudiOP
I'm getting "prop did not match" during hydration. This is a client component (
I see an old commit here which seems to suggest it should work properly: https://github.com/vercel/next.js/commit/960298b3447f8476a43f29d2badb125b697ffff0
"use client"), and I'm using useId(). Should I not? Or is there a safe way to use it?I see an old commit here which seems to suggest it should work properly: https://github.com/vercel/next.js/commit/960298b3447f8476a43f29d2badb125b697ffff0
6 Replies
@Mudi I'm getting "prop did not match" during hydration. This is a client component (`"use client"`), and I'm using `useId()`. Should I not? Or is there a safe way to use it?
I see an old commit here which seems to suggest it should work properly: https://github.com/vercel/next.js/commit/960298b3447f8476a43f29d2badb125b697ffff0
This is a nextjs bug, hope they’ll fix it soon, in the meantime just use useId and ignore it (it only happens in dev mode)
MudiOP
Ah does it. OK, thanks for letting me know. I couldn't find a current issue on their bug tracker about it, do you know if there is one?
MudiOP
Ah great thanks.