0

Inside *.astro page I have a React component, that has client:load directive. Inside the component I have another component that must be loaded only on client. How can I do it?

// pages/index.astro
import ComplexComponent from '../components/ComplexComponent'
...
<ComplexComponent client:load />
...
// components/ComplexComponent.tsx
...
export default function ComplexComponent() {
  ...
  return (
    <>
      <Component />
      <ClientOnly> // <---- ???
        <BrowserComponent/>
      </ClientOnly>
    </>
  )
}
1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.