Support hiding components in devtools with Symbol.for('react.devtools.hide')#997
Support hiding components in devtools with Symbol.for('react.devtools.hide')#997Jessidhia wants to merge 3 commits into
Conversation
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up 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 the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
|
@Kovensky I rebase your PR on current master - at PR #1187 |
|
So the basic usage is supposed to be: function Component(props) { ... }
Component[Symbol.for('react.devtools.hide')] = trueJust wanted to add that this can cause trouble if that component is decorated with other HOCs that use the popular I would therefore prefer #1076. |
|
React DevTools has been rewritten and recently launched a new version 4 UI 🎉 The source code for this rewrite was done in a separate repository and is being merged into the main React repo. Thank you for taking the time to contribute to this extension 🙇♂️ Because this PR is for the version code base, I am closing it. If you'd like to contribute to the new extension, please visit the new repository. |
This allows places such as HOC factory functions to define a
[Symbol.for('react.devtools.hide')] = trueproperty in their generated components in order to support hiding them in the devtools.The change done to
test/example/target.js'swrapWithHocfunction for testing is such an example.No attempt to make the settings window look nice was made, this is also untested in Fiber but if I understand the code correctly it should work.
Guidance on how to test or how to write tests would be welcome.