React-Fiber-Architecture icon indicating copy to clipboard operation
React-Fiber-Architecture copied to clipboard

Question regarding StateNode

Open lmuntaner opened this issue 6 years ago • 0 comments

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!

lmuntaner avatar Nov 13 '18 14:11 lmuntaner