Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pages/tutorials/getting-started-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ Now that we've got the basics covered, let's look at some more advanced features

this.props.glContainer.parent.popout();

Communicating between components is always tricky, but with GoldenLayout it can be even harder if your components are distributed across multiple windows and screens. This is why GoldenLayout comes with an [EventHub](docs/EventEmitter.html) - an EventEmitter that's global to all windows and can be used for inter-component communication, even across windows. The eventHub is exposed through a property called `glEventHub`. To raise an event across all windows, you'd call:
Communicating between components is always tricky, but with GoldenLayout it can be even harder if your components are distributed across multiple windows and screens. This is why GoldenLayout comes with an [EventHub](../docs/EventEmitter.html) - an EventEmitter that's global to all windows and can be used for inter-component communication, even across windows. The eventHub is exposed through a property called `glEventHub`. To raise an event across all windows, you'd call:

this.props.glEventHub.emit( 'something-happend', {some: 'data' });

Here's a ReactJS example making use of these features (give it a go, pop one or both components out and see how they're still able to interact):

<p data-height="268" data-theme-id="7376" data-slug-hash="XdabGJ" data-default-tab="result" class='codepen'>See the Pen <a href='http://codepen.io/wolframhempel/pen/XdabGJ/'>Complex usage with React</a> by Wolfram Hempel (<a href='http://codepen.io/wolframhempel'>@wolframhempel</a>) on <a href='http://codepen.io'>CodePen</a>.</p>
<script async src="//codepen.io/assets/embed/ei.js"></script>
<script async src="//codepen.io/assets/embed/ei.js"></script>