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

Update README.md #10

Merged
merged 1 commit into from
Dec 11, 2023
Merged
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
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,22 @@ Make sure you have a [Miro application](https://developers.miro.com/docs/build-y

### Isomorphic or not?

The [Miro WebSDK](https://developers.miro.com/docs/miro-web-sdk-introduction) is **NOT** isomorphic, meaning that you cannot use it in both server and client environments. This also applies to this library, it won't work you are rendereing your React components in the server.
The [Miro WebSDK](https://developers.miro.com/docs/miro-web-sdk-introduction) is **NOT** isomorphic, meaning that you cannot use it in both server and client environments. This also applies to this library, it won't work wehn you are rendereing your React components in the server.

### What if I am using Nextjs?

Well, in that case, you can wrap your component in a dynamic code block that will defer the component rendering to only execute in the client-side:
#### Using app router
Just make sure that the component that uses the hooks is only rendered on the client by using the `use client` directive on top of your component.
```tsx
'use client'
import { useCurrentUser } from "@mirohq/websdk-react-hooks";

// Your component
```


#### Using pages router
Wrap your component in a dynamic code block that will defer the component rendering to only execute in the client-side:

```tsx
import dynamic from "next/dynamic";
Expand Down