Revert react integration to tracking current dispatcher - #335
Conversation
🦋 Changeset detectedLatest commit: 465cc0c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for preact-signals-demo ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
96f680e to
8415b8a
Compare
|
Size Change: +121 B (0%) Total Size: 68.5 kB
ℹ️ View Unchanged
|
…null as a signal for entering and exiting a component render
…ly and valid dispatchers
8415b8a to
b158661
Compare
|
|
||
| import { signal } from "@preact/signals-react"; | ||
| import { createElement } from "react"; | ||
| import { Route, Routes, MemoryRouter } from "react-router-dom"; |
There was a problem hiding this comment.
I was lazy and just pulled in react-router-dom to write the test for the current issue. I could instead write a minimal reproduction if people would like lol
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| "@preact/signals-react": minor | |||
There was a problem hiding this comment.
Making this a minor bump since it is a non-trivial but also non-breaking change to the react package
|
This is really good job |
… implementation for those versions of React
…ly provide a better devtools experience when the hooks show up in React DevTools
|
When it will be merged? |
|
Hoping it fixes some of my issues as well. |
|
Gonna go ahead and merge this now. Happy to address any feedback afterwards though. Just @-mention in any comments :) |
|
@andrewiggins Thanks a lot for fixing that issue :D |
Revert our react integration back to setting up signal subscription tracking by watching changes in the ReactCurrentDispatcher instead of proxying function Component calls in createElement so it works with more ecosystem libraries such as react-router-dom.
Check the comment in the source for a deeper discussion of the implementation details and choices.
Fixes #251
Fixes #330