Closed gutentag2012 closed 8 months ago
@preact/signals
- for preact
@preact/signals-react
- for react
You can use only one at time
Yep, please do read the instructions: https://github.com/preactjs/signals?tab=readme-ov-file#installation & https://github.com/preactjs/signals/blob/main/packages/react/README.md#react-integration
The Code
Environment
I am using vite and the babel transform plugin within the react babel config of vite.
The Issue
When running the provided code the runtime error
Uncaught TypeError: Cannot read properties of undefined (reading '__H')
occurs. This is not the case when either:@preact/signals
orcount is {count.value}
Notes
It is enough to have an
import "@preact/signals"
somewhere in the imports to result in this behavior, so there is probably some side effect to the import, that results in this behavior. I also tried importing the react signals package in a different file that is loaded before but that also does not resolve the issue.