This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Preserve the server render markup | |
// This has to run before the root render | |
let preservedMarkup = {} | |
if (typeof document !== "undefined") { | |
[...document.querySelectorAll("[data-async-component]")].map(node => | |
preservedMarkup[node.getAttribute("data-async-component")] = node.innerHTML | |
) | |
} | |
// getComponent is a function that returns a promise for a component |
OlderNewer