Browser Only
A wrapper component that renders its children in the browser only, after hydration completes. Useful for components that rely on browser-only APIs like window, document, localStorage, or media queries.
Loading...
API Reference
BrowserOnly
canUseDOM
canUseDOM(): boolean returns true when window and document exist. Use it to guard a DOM API call that runs outside a component, such as a localStorage read in a loader.