Skip to content

Commit

Permalink
Fix suspense check for nextjs
Browse files Browse the repository at this point in the history
Fixes #1165
  • Loading branch information
cookpete committed Feb 17, 2021
1 parent b1e1053 commit a41e3c7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import Player from './Player'
const Preview = lazy(() => import(/* webpackChunkName: 'reactPlayerPreview' */'./Preview'))

const IS_BROWSER = typeof window !== 'undefined' && window.document
const IS_GLOBAL = typeof global !== 'undefined' && global.window && global.window.document
const SUPPORTED_PROPS = Object.keys(propTypes)

// Return null when rendering on the server
// as Suspense is not supported yet
const UniversalSuspense = IS_BROWSER ? Suspense : () => null
const UniversalSuspense = IS_BROWSER || IS_GLOBAL ? Suspense : () => null

const customPlayers = []

Expand Down

0 comments on commit a41e3c7

Please sign in to comment.