-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preact build imports hooks from wrong module #1198
Comments
One convenient way of addressing this would be to build the preact version with export * from 'preact';
export * from 'preact/hooks'; |
I admit that when developing the hooks I did not think about preact much, and I have no knowledge of preact myself either. However, I do want for Downshift to continue to support preact so please feel free to suggest fixes and improvements, with as much detail as possible, and create PRs. Thank you! |
We use preact in combination with downshift as well. |
@MilkyMike can you create a PR with this fix please? |
Hey @silviuaavram, |
The imports for hooks are still coming from |
downshift
version: 6.0.6node
version: 12.18.3npm
(oryarn
) version: 6.14.6Relevant code or config
What you did:
I tried using Downshift with Preact without the
preact-compat
layer. The above code is a somewhat simplified version of theDropdownSelect
component from the documentation.What happened:
First, the Webpack build warns that it can't resolve the
useRef
import:At runtime, I'm getting the following error in Chrome:
Reproduction repository:
None yet
Problem description:
Investigating the issue, I found the following line in the
pract/dist/downshift.esm.js
file:That seems incorrect, as Preact exposes the hook functions not from the
preact
module but frompreact/hooks
.Suggested solution:
The build would need to be changed to import the hooks from
preact/hooks
instead ofpreact
, so the line above would instead be:The text was updated successfully, but these errors were encountered: