refactor(ssr): adjust ssr fragment anchor content

This commit is contained in:
Evan You
2020-03-13 11:55:04 -04:00
parent cad5bcce40
commit a05d41c940
12 changed files with 57 additions and 56 deletions

View File

@@ -76,7 +76,7 @@ export function createHydrationFunctions(
parentSuspense: SuspenseBoundary | null,
optimized = false
): Node | null => {
const isFragmentStart = isComment(node) && node.data === '1'
const isFragmentStart = isComment(node) && node.data === '['
if (__DEV__ && isFragmentStart) {
// in dev mode, replace comment anchors with invisible text nodes
// for easier debugging
@@ -403,8 +403,8 @@ export function createHydrationFunctions(
while (node) {
node = nextSibling(node)
if (node && isComment(node)) {
if (node.data === '1') match++
if (node.data === '0') {
if (node.data === '[') match++
if (node.data === ']') {
if (match === 0) {
return nextSibling(node)
} else {