diff --git a/src/hooks/useStyleRegister.tsx b/src/hooks/useStyleRegister.tsx index 0d709e11..3f1ffcad 100644 --- a/src/hooks/useStyleRegister.tsx +++ b/src/hooks/useStyleRegister.tsx @@ -466,3 +466,20 @@ export function extractStyle(cache: Cache) { return styleText; } + +export function extractStyleNode(cache: Cache) { + const styleKeys = Array.from(cache.cache.keys()).filter((key) => + key.startsWith('style%') + ); + + return styleKeys.map((key) => { + const [styleStr, tokenKey, styleId]: [string, string, string] = + cache.cache.get(key)![1]; + const props = { + [ATTR_TOKEN]: tokenKey, + [ATTR_MARK]: styleId, + dangerouslySetInnerHTML: { __html: styleStr }, + }; + return