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
[Suggestion]: Add a new page for how to communicate between components. #6676
Comments
This is documented on these pages, depending on what you're looking to achieve:
The |
Nowhere in the documentation does it say.
Is using a global event system not a good practice and only using context(or lifting state up) is best practice? |
Correct, the only way to do it safely with concurrent features today is to de-opt with useSyncExternalStore, which has limitation such as forcing fallbacks for existing content. We're aware this is a pain point, though we don't have any solutions to recommend until we build better support for it. |
Thank you. I found an example that uses facebook/react#14988 (comment) I would be happy if React provided a built-in event emitter system like Angular, Vue. 😄 |
Summary
Add a new page for how to communicate between components.
Page
No response
Details
I think it would be helpful to have a page that explains how to communicate between components. This could include a best practice example of a communication between two components that don't have a parent-child relationship.
In the past, old React docs already had these content.
https://web.archive.org/web/20151124041030/http://facebook.github.io:80/react/tips/communicate-between-components.html
References
https://stackoverflow.com/questions/21285923/how-can-i-communicate-between-related-react-components#comment45951998_21285923
The text was updated successfully, but these errors were encountered: