Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix: Async component styles are lost for descendants (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwusanyu-c authored Aug 10, 2023
1 parent 50173c7 commit da1b178
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions packages/sub-style/src/inject/inject-render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,14 @@ const injectToUnMountContent = ''
+ ' )\n'
+ ' }'

const injectToBaseCreateRendererContent = '\n'
+ ' if (\n'
+ ' instance &&\n'
+ ' !(\n'
+ ' instance.parent &&\n'
+ ' (instance.parent.type).__asyncLoader\n'
+ ' )\n'
+ ' ) {\n'
+ ' const styles = (instance.isCEChild && instance.type.styles) || null;\n'
+ ' if (instance.addCEChildStyle && styles) {\n'
+ ' instance.addCEChildStyle(styles, instance)\n'
const injectToBaseCreateRendererContent = 'if (instance && instance.parent) {\n'
+ ' if (!instance.parent.type.__asyncLoader || instance.parent.type.__asyncLoader && instance.parent.parent && instance.parent.parent.isCE) {\n'
+ ' const styles = instance.isCEChild && instance.type.styles || null;\n'
+ ' if (instance.addCEChildStyle && styles) {\n'
+ ' instance.addCEChildStyle(styles, instance);\n'
+ ' }\n'
+ ' }\n'
+ ' }\n'
+ ' }'

let isComponentUpdateFnIdentifier = false
let isUnmountIdentifier = false
Expand Down

0 comments on commit da1b178

Please sign in to comment.