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 {
2323 Value ,
2424} from './shared/types.js' ;
2525
26+ const isBrowser = typeof document !== 'undefined' ;
27+
2628const baseClassName = 'react-datetime-picker' ;
2729const outsideActionEvents = [ 'mousedown' , 'focusin' , 'touchstart' ] as const ;
2830const allViews = [ 'hour' , 'minute' , 'second' ] as const ;
@@ -660,7 +662,7 @@ DateTimePicker.propTypes = {
660662 onClockOpen : PropTypes . func ,
661663 onFocus : PropTypes . func ,
662664 openWidgetsOnFocus : PropTypes . bool ,
663- portalContainer : PropTypes . instanceOf ( HTMLElement ) ,
665+ portalContainer : isBrowser ? PropTypes . instanceOf ( HTMLElement ) : undefined ,
664666 required : PropTypes . bool ,
665667 secondAriaLabel : PropTypes . string ,
666668 secondPlaceholder : PropTypes . string ,
You can’t perform that action at this time.
0 commit comments