docs: improve grammar and example (#3699)
* Improve grammar, render only once * Update README_NEXT.md
This commit is contained in:
parent
b595d3fcba
commit
54dcb73701
@ -153,7 +153,7 @@ To view the full example visit :point_down:
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
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
|
```js
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
@ -161,7 +161,7 @@ export default function IndexPage() {
|
|||||||
const [Comp, setComp] = useState(null);
|
const [Comp, setComp] = useState(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));
|
import("@excalidraw/excalidraw").then((comp) => setComp(comp.default));
|
||||||
});
|
}, []);
|
||||||
return <>{Comp && <Comp />}</>;
|
return <>{Comp && <Comp />}</>;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -159,7 +159,7 @@ To view the full example visit :point_down:
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
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
|
```js
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
@ -167,7 +167,7 @@ export default function IndexPage() {
|
|||||||
const [Comp, setComp] = useState(null);
|
const [Comp, setComp] = useState(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
import("@excalidraw/excalidraw-next").then((comp) => setComp(comp.default));
|
import("@excalidraw/excalidraw-next").then((comp) => setComp(comp.default));
|
||||||
});
|
}, []);
|
||||||
return <>{Comp && <Comp />}</>;
|
return <>{Comp && <Comp />}</>;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user