-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Description
Bug
When I render an imported component which uses the useContext
hook, I get the following error:
Uncaught TypeError: Cannot read property 'context' of undefined
at Module.useContext (index.js:173)
at d../src/example.tsx.exports.Example [as constructor] (example.tsx:7)
It appears that currentComponent
is undefined, but I'm not sure what that means or how to fix it.
I think the issue is related to my build process, so have created a repository which demonstrates the problem.
Steps to reproduce
- Clone https://github.com/oliverdunk/preact-bug
- Run
npm install
- Run
npm run-script run
Expected behaviour
The number 5 is rendered on the page, inside of a H1.
Actual behaviour
When the Example
component is rendered, the previously mentioned error is thrown.
marvinhagemeister, piotr-cz, y-tomimoto, vinyoliver and dav-m85
Metadata
Metadata
Assignees
Labels
No labels