react-bootstrap/react-overlays

useUncontrollableProp not exported by uncontrollable

tastyjingle opened this issue · 3 comments

Installing the package and running 'npm start' or 'build' reports 'useUncontrollableProp not exported by uncrontrollable'

Strangely, it ran fine after the initial installation, however, the above error occurs if you restart your service.

The fix is relatively simple:
/react-overlays/esm/Dropdown.js needs to be modified at lines 5 and 97.

line 5:
import { useUncontrolled } from 'uncontrollable';
line 97:
var _useUncontrolledProp = useUncontrolled(rawShow, defaultShow, rawOnToggle),

At any rate, that was the approach I used to keep the change footprint as small as possible.

Cheers!

taion commented

This looks like an issue in your build pipeline that's somehow pulling in the wrong version of uncontrollable. It's likely that you're somehow deduplicating uncontrollable to an older version that doesn't have this API. This library's specified dependency range for uncontrollable points to the correct version with the correct API.

strange, just did 'npm install react-overlays'. Might be some goofiness there. I'll take a look to see what might have gone wrong.

Edit:

If anyone runs into this, check to make sure 'uncontrollable' dependency is installed.

@taion JFYI useUncontrolledProp was (according to the release notes ) added in 7.1.0, whereas react-overlay still refers to "uncontrollable": "^7.0.0", ;-)

I mean while the version (7.1.0+) can be resolved using the range "^7.0.0", more accurate would be to use "^7.1.0" to force correct version (I had to cope with our yarn.lock)