Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools use the renderer version to detect features on react-reconciler #21262

Closed
leops opened this issue Apr 14, 2021 · 1 comment · Fixed by #21268 or #21269
Closed

DevTools use the renderer version to detect features on react-reconciler #21262

leops opened this issue Apr 14, 2021 · 1 comment · Fixed by #21268 or #21269

Comments

@leops
Copy link

leops commented Apr 14, 2021

This is a followup issue for pmndrs/react-three-fiber#1231

From my understanding of this code, the DevTools parse the version number advertised by the renderer in injectIntoDevTools to select how to parse the internal fiber object. Unfortunately this means that third-party renderers that advertise a version lower than the equivalent React version for the react-reconciler release they are using get misclassified: for instance @react-three/fiber@6.0.13 is using react-reconciler@0.26.2 which is equivalent to react@17.0.2, and since major version 6.y.z is much lower than 17.y.z it uses the default values for the ReactTypeOfWork enum which in turns lead to FunctionComponent getting identified as IndeterminateComponent and hook inspection being unavailable.

A short term solution for renderers is to advertise a React-compatible version number, but ideally this is an implementation detail of the devtools that users of react-reconciler should not have to be aware of (also this means the version number displayed in the devtools is wrong). I'm not sure I'm familiar enough with the internals of the devtools to open a PR for this, but since the version parsing logic is used to detect features that are internal to react-reconciler anyway I guess a solution would be to have the Reconciler package add its own value for the ReactVersion constant along with the parameters sent to the devtools backend, and have the devtools use this string if its available over the renderer version.

@leops leops added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 14, 2021
@bvaughn bvaughn added Component: Developer Tools Type: Discussion and removed Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Apr 14, 2021
@bvaughn bvaughn self-assigned this Apr 14, 2021
@bvaughn
Copy link
Contributor

bvaughn commented Apr 14, 2021

Once #21268 and #21269 land (and get released) newer versions of the reconciler will inject its own version (to be used instead of the renderer version). Unfortunately this won't help you until you upgrade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants