-
Notifications
You must be signed in to change notification settings - Fork 28
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
Not working with Preact #54
Comments
@mrbrianevans Maybe you have missed the change in what parameters need to be passed to // Preact
import {h, Component, createRef} from 'preact'
import ReactHintFactory from 'react-hint'
const ReactHint = ReactHintFactory({createElement: h, Component, createRef}) This fixed it for me on preact v10.3.4. |
Unfortunately, this gives the following error in typescript.
A workaround is to use the following type cast, although it is pretty ugly. const ReactHint = ReactHintFactory({
createElement: h,
Component,
createRef
} as unknown as Parameters<typeof ReactHintFactory>[0]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to use this in a Preact app, but can't get it to work.
I have compat aliases set up in snowpack config:
and typescript paths in tsconfig.json:
I created the factory as recommended in the docs, but still get the above mentioned error.
Has anyone else successfully used
react-hint
with the latest version of preact? (v10.5.14 at time of writing).Any ideas what I could do?
Many thanks,
Brian
The text was updated successfully, but these errors were encountered: