Skip to content

[Fiber] disableNewFiberFeatures bugfix: host component children arrays - #8797

Merged
acdlite merged 6 commits into
react:masterfrom
acdlite:fix-arrays
Jan 25, 2017
Merged

acdlite merged 6 commits into
react:masterfrom
acdlite:fix-arrays

Conversation

@acdlite

@acdlite acdlite commented Jan 15, 2017 •

Copy link
Copy Markdown
Collaborator

When disableNewFiberFeatures was enabled, host component children arrays were treated as empty.

@sebmarkbage

Copy link
Copy Markdown
Contributor

Doesn't this mean that fragments are not disabled?

@sebmarkbage

Copy link
Copy Markdown
Contributor

Also, what about the <div>Text</div> case? This seems to disable single text children, no?

What exactly does this branch do?

@acdlite

acdlite commented Jan 17, 2017

Copy link
Copy Markdown
Collaborator Author

Haha you're right. Ok I'm definitely going to switch this flag to do be the default so we run all the tests against it.

@acdlite

acdlite commented Jan 17, 2017

Copy link
Copy Markdown
Collaborator Author

Updated. I moved the top-level invariant to the DOM renderer because the requirements vary too much. E.g. we need to allow null inside the reconciler because that's how we unmount. Also, React Art supports arrays at the root.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What you're really saying here is that they're allowed to return anything (including strings, arrays etc.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated

@acdlite

acdlite commented Jan 18, 2017

Copy link
Copy Markdown
Collaborator Author

@sebmarkbage @spicyj Ping

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems unnecessary to fork this whole function now. Can't you just add this conditional down below behind a smaller if (ReactFeatureFlags.disableNewFiberFeatures) { instead of forking the whole function?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Forking the entire function was the only way I could get it down to a single check. But you're right that there's a lot of overlap and it's weird to fork the entire thing. I split it out into three checks instead.

Easier to follow this way, and less chance the two paths will get
out of sync.
@acdlite
acdlite merged commit 63edf30 into react:master Jan 25, 2017
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
[Fiber] disableNewFiberFeatures bugfix: host component children arrays
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
[Fiber] disableNewFiberFeatures bugfix: host component children arrays
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