Skip to content

Commit

Permalink
Also change return type of browserOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed May 9, 2022
1 parent fbaff3b commit a893b52
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/prerender/src/browserUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ export const useIsBrowser = () => {
}, [])
}

export const BrowserOnly = ({
children,
}: {
children: ReactElement
}) => {
export const BrowserOnly = ({ children }: { children: ReactElement }) => {
const isBrowser = useIsBrowser()

return isBrowser && children
return isBrowser ? children : null
}

0 comments on commit a893b52

Please sign in to comment.