Closed saurabswaarm closed 2 months ago
Could you please reproduce the error using StackBlitz so I can take a look? You can fork this template to get started.
Hi, here's the code, but it seems to work fine. I can access the signal without having an assignment operator. I can't reproduce my error means it has something to do with my set up.
https://stackblitz.com/edit/vitejs-vite-cyswtz?file=src%2Fmain.jsx
But in my codebase we are using webpack and babel also in the babel trasform i have set it to manual
,
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
["@babel/transform-runtime", {
"regenerator": true
}],
["module:@preact/signals-react-transform", {
"mode":"manual"
}]
]
}
as auto
gives me this error
Warning: Invalid hook call. Hooks can only be called inside of the body of a function component.
Have you checked if the problem happens only with deepsignal or if it also occurs with normal signals?
now that i test it out with just preact, it happens with preact too. Doesn't matter if I use the useSignals hook or if i annotate my components like
/**
* @useSignals
*/
const Component = (props) => {
More info. "webpack": "^5.51.1", "webpack-cli": "^4.7.2", "webpack-dev-server": "^3.11.2" "babel-loader": "^8.2.2", "@babel/core": "^7.15.0",
Another interesting observation is our node is locked in at v14.
I think I'll file an issue over at preact as well. We can close this because this is clearly not an issue with deep signals.
We can close this because this is clearly not an issue with deep signals.
Alright, I'll close it then. Feel free to reopen it if you find that the issue is indeed related to deepsignal.
I'm unable to get use signal effect to fire in my React Application if I follow the following set up.(
adjRow
is the deep signal.)However I can get the useSignalEffect to fire if instead I assign adjRow.action to a variable.
is this something to do with the way signals / reactivity works ?
Please not i am using / have tried babel transform and the useSignals hook to wire my react appication in.
Versions