react icon indicating copy to clipboard operation
react copied to clipboard

Error in 'Using Immutable Data Structures' section of Docs

Open kastentx opened this issue 9 years ago • 4 comments

Do you want to request a feature or report a bug?

  • Report a bug.

What is the current behavior?

  • In the Optimizing Performance section of the docs, there is a sub-section called Using Immutable Data Structures. At the end there is a sentence "In this case, since a new reference is returned when mutating x, we can safely assume that x has changed."

The sentence should read, if my assumption is correct, "... we can safely assume that x has not changed

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).

  • The doc in question is posted here: https://facebook.github.io/react/docs/optimizing-performance.html

What is the expected behavior? As described above, "... we can safely assume that x has not changed

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? N/A

kastentx avatar Jun 04 '17 06:06 kastentx

Hello, I'm working on it (first contribution).

Assitan avatar Jun 07 '17 18:06 Assitan

Hey @Assitan! Just a heads up, there's already an open PR for this fix: https://github.com/facebook/react/pull/9845

aweary avatar Jun 07 '17 18:06 aweary

Ok :)

Assitan avatar Jun 07 '17 19:06 Assitan

Fixed in https://github.com/facebook/react/pull/9845.

gaearon avatar Jul 11 '17 12:07 gaearon