Skip to content

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Feb 8, 2019

Fixes #14782. If nothing is provided, there should be no dependencies — not [ref] alone.

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.

You checked the shallow renderer and server renderer too?

// TODO: If deps are provided, should we skip comparing the ref itself?
const effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : deps;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
deps !== null && deps !== undefined ? deps.concat([ref]) : deps;
deps !== null && deps !== undefined ? deps.concat([ref]) : null;

Nit: Should only be null, not undefined. I wondered why this wasn't a type error but it's because mountEffectImpl and updateEffectImpl contain their own type check; we might inline those later.

// TODO: If deps are provided, should we skip comparing the ref itself?
const effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : deps;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

@gaearon
Copy link
Collaborator Author

gaearon commented Feb 11, 2019

You checked the shallow renderer and server renderer too?

Just checked — both are noops.

@gaearon gaearon merged commit f24a0da into facebook:master Feb 11, 2019
@gaearon gaearon deleted the fix-uih branch February 14, 2019 19:25
This was referenced Sep 20, 2019
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