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
Bug(devtools): complex types ignored sometimes in useDebugValue #17955
Comments
|
I would like to take a look. |
|
This issue is all yours! I've added the "good first issue (taken)" label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim. Cheers! |
|
Thanks. I'm working on it. |
|
@wfnuser I don't think I understand what you're asking. |
|
@wfnuser currently working as expectedmissing debug value in componentmissing hooks in component@bvaughn needs to confirm if this is correct. I can write some tests tomorrow if you're not sure where to start. Having failing test might help experimenting with various pieces of code to see what does what. |
Thanks a lot. I still need to learn more about how hooks work. If you can provide some tests, that will be very helpful. |
|
Not sure if I agree with "no hooks at all" component. Seems like a use case that I'm not sure if DevTools needs to support. |
Because there are no built-in hooks used other than |
|
@bvaughn I'm quite lost where the tests for these components are located. The data seems to be wired up correctly. It looks like the view is not working but I can't find tests for those. Is there some documentation how to test devtools? |
Yes. There's no need to use such a hook at all, since hooks calls can't be conditional to begin with (without leading to errors).
You'd probably want to add tests to the following places:
No. |
|
Ah I couldn't get it pick up react-devtools-shared but this isn't included in |
Just to be clear: There's not conditional call there. It's just not using an built-in hooks other than |
I understand. My point though is that- since hooks calls can't be conditional, this could only ever be an "empty" hook- which serves no purpose and so I don't see it as a use case we should ever need to support. |
I'm confused. A custom hook with no built-in hooks is the only hook that's displaying complext types. It's only not working for the component that doesn't use built-in hooks (other than As soon as a custom hook uses |
|
I'm not sure where the confusion is. I'm just saying that the "no hooks at all" component is not a use case I care about us supporting, because that's a "custom hook" that literally only uses the debug value hook and nothing else. That use case is not important to support. (If it works, fine. If it doesn't work, fine.) |
I originally thought at least something is working. But since we don't care about the case that is working it's a bit more complicate to understand for an outside contributor how to create a test and feature since I have nothing to work off. |






eps1lon commentedFeb 1, 2020
React version: 0.0.0-241c4467e (current
next) and 16.12.0Devtools: 4.4.0 (1/3/2020). [...] Created from revision f749045 on 1/3/2020.
Steps To Reproduce
AppComponentNoHooksAtAlldisplays no hooks at allIgnoredComplexValuedisplayes the custom hook but without a valueNoHooksAtAlldisplays the custom hook with its valueLink to code example:
The current behavior
Complex values (and custom hooks) are sometimes not displayed
The expected behavior
Implementation of components and hooks should not affect if these are displayed.
The text was updated successfully, but these errors were encountered: