maslianok / react-resize-detector

A Cross-Browser, Event-based, Element Resize Detection for React
http://maslianok.github.io/react-resize-detector/
MIT License
1.25k stars 91 forks source link

ESM build not working #85

Closed ejdzipi closed 4 years ago

ejdzipi commented 4 years ago

Hello,

i have react components library, that is bundled with rollup.js. When i import react-resize-detector, i am getting error:

[!] Error: 'bool' is not exported by node_modules\prop-types\index.js
node_modules\react-resize-detector\lib\esm\components\ResizeDetector.js (25:9)
23: import ResizeObserver from 'resize-observer-polyfill';
24: import rafSchd from 'raf-schd';
25: import { bool, number, string, shape, func, any, node } from 'prop-types';
                    ^
26: import { getHandle, isFunction, isSSR, isDOMElement } from "../lib/utils";
27: import ChildWrapper from "./ChildWrapper";
Error: 'bool' is not exported by node_modules\prop-types\index.js

When i use this import: import ReactResizeDetector from 'react-resize-detector/lib/', error is gone and resize detector is working.

Any clue what causes this problem? Thanks

maslianok commented 4 years ago

Sorry that it took so much time for me to answer.

Should be fixed in v5.1.1

ejdzipi commented 4 years ago

Tested, fixed. Thanks 🎉