Replies: 1 comment
-
This ties in really nicely to react component stacks because it helps explain the component lifecycle |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description:
When you're within a React render function:
You don't know if the component is on it's first mount (or remounting), or if it's a re-render. The lifecycle implication can be important when root causing a bug:
Usually that I want to know is did this component accidentally remount when it shouldn't have so I can look at the parent to find out why, or is it another problem.
I can do this manually but it's very tedious. I go up the stack to React calling the render function. Locate the FiberNode and check for
alternate
.First mount:
Re-render:
It would be nice to have a feature to help with this. Either let me run a small expression and plug it into the UI. This is harder then a typically console because I have to change the stack frame.
Or these feature could be built in. Basically go up the stack, look for an object that has the fiber properties (alternate, lastEffect, etc...) and report relevant one.
Beta Was this translation helpful? Give feedback.
All reactions