Skip to content

Fix shouldUpdateReactComponent not considering props.key#711

Closed
syranide wants to merge 1 commit into
facebook:masterfrom
syranide:rootkey
Closed

Fix shouldUpdateReactComponent not considering props.key#711
syranide wants to merge 1 commit into
facebook:masterfrom
syranide:rootkey

Conversation

@syranide
Copy link
Copy Markdown
Contributor

Apparently @spicyj already has a pending PR for this that should be considered instead, #591.


key is currently only obeyed by descendants of the root-node, the root-node itself does not obey key. This simple fix ensures that it works on the root-node as well.

I would consider this a bug and speaking hastily to petehunt, he seemed to agree:

<@petehunt> yeah i think that would be a bug

My personal motivation for this is my <swf>-component that I will be releasing, it requires this to support changing src at run-time (although other workarounds do exist). In my opinion, there's no reason why the root-node should be any different from the other children in this regard.

@vjeux
Copy link
Copy Markdown
Contributor

vjeux commented Dec 25, 2013

I think that makes sense. cc @yungsters

@sophiebits
Copy link
Copy Markdown
Collaborator

See #591.

@syranide
Copy link
Copy Markdown
Contributor Author

@spicyj Ah, look at that. Yeah, your PR looks perfect, just need to light someones ass on fire then. :)

So this PR should be closed.

@petehunt
Copy link
Copy Markdown
Contributor

Let's go with @spicyj's PR. Sorry, but thanks for lighting the fire!

@petehunt petehunt closed this Dec 26, 2013
@syranide
Copy link
Copy Markdown
Contributor Author

@petehunt No need to be "sorry", it's the right decision. :)

@syranide syranide deleted the rootkey branch December 27, 2013 13:31
josephsavona added a commit that referenced this pull request May 15, 2024
Redo of #711 

Note that one test (switch.js) is failing, i'm working on a fix.
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

Successfully merging this pull request may close these issues.

4 participants