I have a three.js component that should only be rendered client side, how do I do this with Remix? Does Remix expose any utilities to help determine if we're in a server or client context? Could not find anything.
Here is an example of what I'm attempting to do with fictional hooks that don't exist in remix.
import React from 'react';
import { useRemixContext } from '@remix-run/react';
const MyComponent = () => {
const remixContext = useRemixContext();
if(remixContext.server) {
return null;
}
return <div>Should only be rendered on the client</div>
}
<ClientOnly>
fromremix-utils
github.com/sergiodxa/remix-utils#clientonly – Overtop