Created
July 14, 2019 14:55
-
-
Save catwell/0f5a8a781e3236d01af51d323272b110 to your computer and use it in GitHub Desktop.
avoid-flash-of-unstyled-slot-stencil
This file contains hidden or 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
my-component { | |
display: none; | |
} | |
my-component[is-loaded] { | |
display: block; | |
} |
This file contains hidden or 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
@Component({ | |
tag: 'my-component, | |
shadow: true, | |
}) | |
export class MyComponent { | |
@Prop({reflect: true}) isLoaded : boolean; | |
componentDidLoad () : void { | |
this.isLoaded = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Better alternative but unsupported in IE / Edge: