I’m creating a react component that needs to have a different parent on the server vs the client.
const Router = runtime.isServerSide ? Server : Client;
<Router>
<Child />
</Router>
The Server component takes different props than the Client component.
I used conditional rendering to fix this, but I’d like to be able to specify the props in the declaration for Router instead
{runtime.isServerSide ? (
<Server serverProp={123}>
<Child />
</Server
) : (
<Client clientProp={false}>
<Child>
</Client>
)}
New contributor
Bob Bobarker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.