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

Question regarding StateNode #6

Open
lmuntaner opened this issue Nov 13, 2018 · 0 comments
Open

Question regarding StateNode #6

lmuntaner opened this issue Nov 13, 2018 · 0 comments

Comments

@lmuntaner
Copy link

Hi!

I found this very helpful. I am still not sure I fully understand everything, but I think it helped me get a better deep understanding of React.

However, I have a question which I am not sure whether it's a typo.

In the list of properties of a Fiber you say:

stateNode: The local state associated with this fiber

However, then it seems that the stateNode actually contains an instance of a component.

For example, in processChildContext:

parameters(fiber, type, parentContext)
	const instance = fiber.stateNode;
  	const childContextTypes = type.childContextTypes;
	let childContext
	get the instance of the child context using the stop/start PhaseTimers
	return {...parentContext, ...childContext};

When you are talk about the local state of the Fiber, what do you mean? Is that the local state of the component?

Thanks and keep sharing this notes!

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

No branches or pull requests

1 participant