Skip to content

Commit

Permalink
Updated React docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandstedt committed Oct 27, 2020
1 parent 93a7e8e commit b2fa29f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/tutorials/usage-with-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ You can see the full example and try it out here: [CodeSandbox](https://codesand
There is also a [button example](https://codesandbox.io/s/mojs-react-example-kbikb?file=/src/Button.js) with a `Burst` animation using an object pooling array.

::: tip Usage with Server Side Rendering (SSR)
Note that MoJS is a client-side library, and is not meant to be run on a server. So if you are using a library like Next.js or Gatsby, make sure not to run your MoJS code on the server, just on the client side. You can do this by using the `useEffect` hook like we did above, or using a dynamic import ([read more here](https://dev.to/vvo/how-to-solve-window-is-not-defined-errors-in-react-and-next-js-5f97)).

Note that this is a client-side library, and is not meant to be run on a server. So if you are using a library like Next.js, Gatsby, Nuxt.js or Angular Universal, make sure not to run your MoJS code on the server, just on the client side. How to do that differs from the library you are using. In React based libraries you can use the `useEffect` hook or a dynamic import ([read more here](https://dev.to/vvo/how-to-solve-window-is-not-defined-errors-in-react-and-next-js-5f97)).
:::

Happy animating!

0 comments on commit b2fa29f

Please sign in to comment.