How to prevent usage of client only api's on the server? (tanstack router)
Hey 🙂
I have a hook, which is initializing a
new RTCPeerConnection(). This errors on the server (obviously). How do I best handle this case? I could try to return early, if process.browser is not defined. But this will lead me to conditional hook calling.1 Reply
optimistic-gold•2y ago
if the hook initializes the connection in an effect or in useSyncExternalStore, it shouldn't run on the server