Closed soderlind closed 2 years ago
Solved it (started with React in Juli, so I'm a bit n00b).TL;DR: Wrapped it in <ClientOnly></ClientOnly>
Created a component:
const Hamburger = ({ onClick }) => {
return (
<ClientOnly>
{() => (
<div className="nav-toggle" onClick={onClick}>
<div className="bar"></div>
<div className="bar"></div>
</div>
)}
</ClientOnly>
);
};
export default Hamburger;
and calling it from root.tsx
:
<Hamburger
onClick={() => {
setFullMenuVisible(!fullMenuVisible);
}}
/>
.. and fixing this, also fixed #1
I merged remix-sanity-studio-v3 with my code, any reason why
useState
not working any more?I'm using
react-spring
to toggle a mobile menu (it's running inroot.tsx
):