fix(react): fallback to React 18 internals for getting component names #139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In reviewing the current state of the
v1.x
branch preparatory to publishing a new v1 minor version, I determined that theuseReactComponentId
hook is too optimistically assuming it'll be used in React 19. While this doesn't break anything when used with React 18, it does mean poorer dev X since components will add generic ids to the atom graph. Zedux v1 is supposed to be completely compatible with React 18, so I think it should still support this dev X.To be clear, v2 will work with React 18 as well, but with some caveats. The dev X of seeing the component name that added a graph dependency in Zedux is not something that React itself officially supports. So I'm fine with this change being omitted in v2. When upgrading to Zedux v2, we'll recommend to also upgrade to React 19 to get this dev X back.