Skip to content

Question regarding StateNode #6

Open
@lmuntaner

Description

@lmuntaner

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions