mirror of
https://github.com/foomo/foomo-docs.git
synced 2025-10-16 12:35:40 +00:00
fix: ssr fixes
This commit is contained in:
parent
5821bbfe8a
commit
e8e443f1e0
@ -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 }) => {
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user