docs: clarify JSX equality#7789
docs: clarify JSX equality#7789vib3-ch3ck wants to merge 0 commit intoreactjs:mainfrom vib3-ch3ck:main
Conversation
|
Hi @vib3-ch3ck! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
rickhanlonii
left a comment
There was a problem hiding this comment.
This is not correct. JSX is never "equal" because it returns new objects every time. The purity aspect mentioned in the docs talk about it returning the "same JSX" which is more about when the component runs, the same thing is returned every time, so it doesn't depend on something outside that could change it.
It's not really about JSX so much as the same output, and that doesn't mean you should "construct" and equal output (in that case you would need to know how to construct it to make it equal), it should execute the same code paths and return the same output each time.
#7751