-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Cannot read properties of undefined (reading '__H') in Deno Fresh #2
Comments
Sorry, I am not Deno Fresh user and I will need help with this issue. Please send PR if you will find the source. |
Not sure what the problem is. I tried writing the hook myself, and it worked without problems. But, if I use this package, it breaks. import { listenKeys } from 'nanostores'
function useStore(store, opts = {}) {
let [, forceRerender] = useState({})
useEffect(() => {
let batching: number|undefined, timer, unlisten
let rerender = () => {
if(!batching) {
batching = 1
timer = setTimeout(() => {
batching = undefined
forceRerender({})
})
}
}
if(opts.keys) {
unlisten = listenKeys(store, opts.keys, rerender)
} else {
unlisten = store.listen(rerender)
}
return () => {
unlisten()
clearTimeout(timer)
}
}, [store, '' + opts.keys])
return store.get()
} |
Same trouble with my integration. Copy paste code to local codebase (as above) works well. |
Importing |
I'm trying to use this in Deno Fresh
The text was updated successfully, but these errors were encountered: