From 457a7b6d9df2aeb07f53d101e94ccfd8e631cb7d Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Tue, 8 Aug 2023 10:48:42 +0200 Subject: [PATCH] Fix "Failed prop type: TimeRangePicker: prop type `portalContainer` is invalid" error --- src/TimeRangePicker.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TimeRangePicker.tsx b/src/TimeRangePicker.tsx index bcce07f..52b1b12 100644 --- a/src/TimeRangePicker.tsx +++ b/src/TimeRangePicker.tsx @@ -480,7 +480,6 @@ TimeRangePicker.propTypes = { onClockOpen: PropTypes.func, onFocus: PropTypes.func, openClockOnFocus: PropTypes.bool, - portalContainer: isBrowser ? PropTypes.instanceOf(HTMLElement) : undefined, rangeDivider: PropTypes.node, required: PropTypes.bool, secondAriaLabel: PropTypes.string, @@ -489,4 +488,8 @@ TimeRangePicker.propTypes = { value: isValueOrValueArray, }; +if (isBrowser) { + TimeRangePicker.propTypes.portalContainer = PropTypes.instanceOf(HTMLElement); +} + export default TimeRangePicker;