Update 14-communicate-between-components.md

This commit is contained in:
Alexander Tseung
2014-12-21 00:14:34 -08:00
parent f7166d0c97
commit 92c37ffb3d

View File

@@ -38,4 +38,4 @@ React.render(
Notice the use of `bind(this, arg1, arg2, ...)`: we're simply passing more arguments to `handleClick`. This is not a new React concept; it's just JavaScript.
For communication between two components that don't have a parent-child relationship, you can set up your own global event system. Subscribe to events in `componentDidMount()`, unsubscribe in `componentWillUnmount()`, and when you receive an event, call `setState()`.
For communication between two components that don't have a parent-child relationship, you can set up your own global event system. Subscribe to events in `componentDidMount()`, unsubscribe in `componentWillUnmount()`, and call `setState()` when you receive an event.