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

In SSR, Store Elements of Composites on the Stack for Warnings #10187

Merged
merged 1 commit into from
Jul 19, 2017

Conversation

sebmarkbage
Copy link
Collaborator

In DEV mode this keeps an additional sub-stack within the stack of the
server renderer. This substack keeps track of all the elements that we
resolved to get to to the next processing frame.

This lets us recreate the full composite component stack for warnings.
Normally the stack only contains host components.

We reset this every time we're going to resolve another sibling.

currentDebugStack = stack;
ReactDebugCurrentFrame.getCurrentStack = getStackAddendum;
};
var pushElementToDebugStack = function(element) {
if (currentDebugElementStack !== null) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need this null check because this reset isn't reentrant so it might be reset. See follow up in #10188

Copy link
Collaborator

@acdlite acdlite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have full context but this looks ok to me

In DEV mode this keeps an additional sub-stack within the stack of the
server renderer. This substack keeps track of all the elements that we
resolved to get to to the next processing frame.

This lets us recreate the full composite component stack for warnings.
Normally the stack only contains host components.

We reset this every time we're going to resolve another sibling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants