fix: twind styles not updated on partial nav (#2017)

This commit is contained in:
Marvin Hagemeister
2023-11-06 14:04:43 +01:00
committed by GitHub
parent 8b846816a6
commit c172af67cf
7 changed files with 96 additions and 34 deletions
+2 -6
View File
@@ -24,14 +24,10 @@ export default function(state) { hydrate(options, state); }`;
name: "twind",
entrypoints: { "main": main },
async renderAsync(ctx) {
const res = await ctx.renderAsync();
await ctx.renderAsync();
const cssText = stringify(sheet.target);
const scripts = [];
if (res.requiresHydration) {
scripts.push({ entrypoint: "main", state: [] });
}
return {
scripts,
scripts: [{ entrypoint: "main", state: [] }],
styles: [{ cssText, id: STYLE_ELEMENT_ID }],
};
},