shinzou
shinzou
TTCTheo's Typesafe Cult
Created by shinzou on 6/9/2023 in #questions
<template> and stubborn hydration warnings...
So in case you don't know, here's the default behavior of declarative shadow DOM: 1. <template shadowrootmode="open"> gets served to the client. 2. the HTML parser interprets this as shadow DOM in-place, hence removing the <template> tag. and of course 3. React/Next says "wait, that doesn't match what I saw on the server..." Support of DSD kinda necessitates this behavior, so I'm trying to find a work-around. suppressHydrationWarning no longer works at all, because React recently changed its behavior (https://github.com/facebook/react/issues/25627) claiming it was never supposed to ignore element children, and that was a bug. Now you can only suppress warnings over attributes and text content. At least one other person (https://github.com/facebook/react/issues/26071) has encountered this issue, but their workaround involves modifying react-dom and as a library author, I don't really have that kind of say in the consumer's project. So yeah, main question is... any suggestions? How can I hack around this so the consumers of my library don't get a thousand errors?
2 replies
TTCTheo's Typesafe Cult
Created by shinzou on 5/10/2023 in #questions
@import is always async?
4 replies