Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/calm-deers-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lit-labs/react': patch
---

Only add `suppressHydrationWarning` prop when rendered in the client. This will prevent `suppresshydrationwarning` attribute being added to the host element when using `@lit-labs/ssr-react`.
8 changes: 5 additions & 3 deletions packages/labs/react/src/create-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ the element.`);
return createElement<React.HTMLAttributes<I>, I>(tag, props);
}

// Suppress hydration warning for server-rendered attributes, including
// "defer-hydration"
props['suppressHydrationWarning'] = true;
if (!NODE_MODE) {
// Suppress hydration warning for server-rendered attributes, including
// "defer-hydration"
props['suppressHydrationWarning'] = true;
}

return createElement<React.HTMLAttributes<I>, I>(tag, props);
}
Expand Down