-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is it safe to use __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ? #3896
Comments
No, it’s not safe to use. That’s why it has a scary name. We offer no guarantees about what will happen if you access things there. The behavior can change on any release. We strongly recommend against touching it in your library if you don’t want that library to break later.
If you use
No, the linked answer will most definitely break. It’s not clear to me what was the original problem that the author tried to solve, but there are almost always better ways to approach it. |
@gaearon thank you for the response, however,
Why don't you provide stable API for some internal state of React itself so developers could potentially do anything they want with it (without annoyingly forking and losing any feature updates)? |
You asked a question (“is it safe”), I provided a response (“it’s not”). If you choose to ignore this, it’s your decision, but we provide no guarantees. I don’t know what else to say here.
You’re welcome to ask for specific features as a public API in separate issues that describe specific use cases. You’re welcome to file RFCs for these proposals. |
thank you, @gaearon, |
Sure! In the RFC repository. |
Favorite issue so far |
quintessential web developer mindset right here |
As an Android developer, I feel this question so hard |
let's not spam people. |
I want to use the undocumented property
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
which holds some interesting insights and can be useful in some cases.I'm developing React libraries.
for example using
React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner.current.type.displayName
I could warn the user the name of the component that consumed a custom hook without wrapping it with required context.thank you.
The text was updated successfully, but these errors were encountered: