fix: ssr fixes

This commit is contained in:
Philipp Mieden 2025-09-18 13:51:47 +02:00
parent 5821bbfe8a
commit e8e443f1e0
2 changed files with 8 additions and 5 deletions

View File

@ -18,7 +18,7 @@ import React, { useEffect, useState } from "react";
import { Iframe } from "./Iframe";
import { IsItCool } from "./IsItCool";
import Highlight, { defaultProps } from "prism-react-renderer";
import { Highlight, defaultProps } from "prism-react-renderer";
import Link from "@docusaurus/Link";
export const GoPlayground = (props: { id: string; proportion: number }) => {

View File

@ -15,11 +15,14 @@ export const IsItCool = (props: {
topic: string;
id: string;
}) => {
const [isCool, setIsCool] = useState(getISCool(props.id));
const [isCool, setIsCool] = useState(false);
useEffect(() => {
console.log("well it is cool",props.id, {isCool, SSR})
}, [isCool, SSR]);
if (!isCool) {
if (localStorage.getItem(props.id) === yes) {
setIsCool(true);
}
}, [props.id]);
if (SSR || !isCool) {
return (
<div>
<button