preactjs/signals

`Out-of-order effect` error thrown with `react-router-dom`

nathan-prijot opened this issue · 4 comments

I'm encountering the error Out-of-order effect and I cannot find information about what this error means. It happens in a custom hook using a signal when react-router-dom makes a navigation back to the component using this custom hook.

Replacing the .value in the custom hook to a .peek() fixed the issue but of course it no longer update the component. It's probably something to do with my implementation but I would like to have some insight as to why this error is thrown so I can identify the faulty usage.

Do you use 2.0.1 version with babel plugin?

I am using the 2.0.0 version with the useSignals hook. I do no use the babel plugin.

Can you provide repro in codesandbox or stackblitz? I have an assumption that it can be cause when component rerenders itself recursively

Closing, reproductions are necessary if you want us to be able to help.

We can reopen this if a reproduction is provided.