Skip to content

Commit b81dcce

Browse files
committed
Add an SSR-safe check for the Element type
Resolves #259.
1 parent 5e5518f commit b81dcce

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [6.0.2](https://github.com/jakezatecky/react-dual-listbox/compare/v6.0.0...v6.0.2) (2023-02-06)
4+
5+
### Fixed
6+
7+
* Add SSR-safe check for the `Element` type
8+
39
## [6.0.1](https://github.com/jakezatecky/react-dual-listbox/compare/v6.0.0...v6.0.1) (2023-12-13)
410

511
### Fixed

src/js/shapes/refShape.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import PropTypes from 'prop-types';
22

3+
const elementType = typeof Element === 'undefined' ? () => {} : Element;
34
const refShape = PropTypes.oneOfType([
45
PropTypes.func,
5-
PropTypes.shape({ current: PropTypes.instanceOf(Element) }),
6+
PropTypes.shape({ current: PropTypes.instanceOf(elementType) }),
67
]);
78

89
export default refShape;

0 commit comments

Comments
 (0)