Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

common: update and simplify code #1987

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions react/src/lib/Giscus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export default function Giscus({

useEffect(() => {
if (mounted) return;
void import('giscus');
setMounted(true);
void import('giscus').then(() => setMounted(true));
}, []);

if (!mounted) return null;
Expand Down
3 changes: 1 addition & 2 deletions solid/src/lib/Giscus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ export default function Giscus(props: GiscusProps) {

createEffect(() => {
if (mounted()) return;
void import('giscus');
setMounted(true);
void import('giscus').then(() => setMounted(true));
});

// Note: make sure to use kebab-case for the web component's attributes,
Expand Down
3 changes: 1 addition & 2 deletions svelte/src/lib/Giscus.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
let mounted = false;
onMount(() => {
mounted = true;
void import('giscus');
void import('giscus').then(() => (mounted = true));
});
</script>

Expand Down
3 changes: 1 addition & 2 deletions vue/src/lib/Giscus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ defineProps<{
const mounted = ref(false);

onMounted(() => {
mounted.value = true;
import('giscus');
import('giscus').then(() => (mounted.value = true));
});
</script>

Expand Down
Loading