File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ import type {
23
23
Value ,
24
24
} from './shared/types.js' ;
25
25
26
+ const isBrowser = typeof document !== 'undefined' ;
27
+
26
28
const baseClassName = 'react-datetime-picker' ;
27
29
const outsideActionEvents = [ 'mousedown' , 'focusin' , 'touchstart' ] as const ;
28
30
const allViews = [ 'hour' , 'minute' , 'second' ] as const ;
@@ -660,7 +662,7 @@ DateTimePicker.propTypes = {
660
662
onClockOpen : PropTypes . func ,
661
663
onFocus : PropTypes . func ,
662
664
openWidgetsOnFocus : PropTypes . bool ,
663
- portalContainer : PropTypes . instanceOf ( HTMLElement ) ,
665
+ portalContainer : isBrowser ? PropTypes . instanceOf ( HTMLElement ) : undefined ,
664
666
required : PropTypes . bool ,
665
667
secondAriaLabel : PropTypes . string ,
666
668
secondPlaceholder : PropTypes . string ,
You can’t perform that action at this time.
0 commit comments