File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ export default function Giscus({
2222
2323 useEffect ( ( ) => {
2424 if ( mounted ) return ;
25- void import ( 'giscus' ) ;
26- setMounted ( true ) ;
25+ void import ( 'giscus' ) . then ( ( ) => setMounted ( true ) ) ;
2726 } , [ ] ) ;
2827
2928 if ( ! mounted ) return null ;
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ export default function Giscus(props: GiscusProps) {
66
77 createEffect ( ( ) => {
88 if ( mounted ( ) ) return ;
9- void import ( 'giscus' ) ;
10- setMounted ( true ) ;
9+ void import ( 'giscus' ) . then ( ( ) => setMounted ( true ) ) ;
1110 } ) ;
1211
1312 // Note: make sure to use kebab-case for the web component's attributes,
Original file line number Diff line number Diff line change 2828 let mounted = false ;
2929
3030 onMount (() => {
31- mounted = true ;
32- void import (' giscus' );
31+ void import (' giscus' ).then (() => (mounted = true ));
3332 });
3433 </script >
3534
Original file line number Diff line number Diff line change @@ -31,8 +31,7 @@ defineProps<{
3131const mounted = ref (false );
3232
3333onMounted (() => {
34- mounted .value = true ;
35- import (' giscus' );
34+ import (' giscus' ).then (() => (mounted .value = true ));
3635});
3736 </script >
3837
You can’t perform that action at this time.
0 commit comments