From 54dcb7370149fde2064e69a3c71bd490cd6df566 Mon Sep 17 00:00:00 2001 From: Karl Horky Date: Sun, 6 Jun 2021 22:08:05 +0200 Subject: [PATCH] docs: improve grammar and example (#3699) * Improve grammar, render only once * Update README_NEXT.md --- src/packages/excalidraw/README.md | 4 ++-- src/packages/excalidraw/README_NEXT.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/excalidraw/README.md b/src/packages/excalidraw/README.md index 9ee4da9a4c..3e9caec92f 100644 --- a/src/packages/excalidraw/README.md +++ b/src/packages/excalidraw/README.md @@ -153,7 +153,7 @@ To view the full example visit :point_down: -Since Excalidraw doesn't support server side rendering yet so you will have to make sure the component is rendered once host is mounted. +Since Excalidraw doesn't support server side rendering yet, you should render the component once the host is mounted. ```js import { useState, useEffect } from "react"; @@ -161,7 +161,7 @@ export default function IndexPage() { const [Comp, setComp] = useState(null); useEffect(() => { import("@excalidraw/excalidraw").then((comp) => setComp(comp.default)); - }); + }, []); return <>{Comp && }; } ``` diff --git a/src/packages/excalidraw/README_NEXT.md b/src/packages/excalidraw/README_NEXT.md index 00e43d1664..f1b9382af4 100644 --- a/src/packages/excalidraw/README_NEXT.md +++ b/src/packages/excalidraw/README_NEXT.md @@ -159,7 +159,7 @@ To view the full example visit :point_down: -Since Excalidraw doesn't support server side rendering yet so you will have to make sure the component is rendered once host is mounted. +Since Excalidraw doesn't support server side rendering yet, you should render the component once the host is mounted. ```js import { useState, useEffect } from "react"; @@ -167,7 +167,7 @@ export default function IndexPage() { const [Comp, setComp] = useState(null); useEffect(() => { import("@excalidraw/excalidraw-next").then((comp) => setComp(comp.default)); - }); + }, []); return <>{Comp && }; } ```