React.js: Composing components to create tabs
问题 I’m trying to make a tabs component. TabsSwitcher and TabsPanel must be separate components so they could be used anywhere in DOM, e.g. TabsSwitcher doesn’t have to be followed by TabsPanel. To make it work, I need to somehow connect these components. Furthermore, TabsSwitcher must be able to tell TabsPanel when a tab was clicked. /** @jsx React.DOM */ var TabsExample = React.createClass({ render: function() { var tabs = [ {title: 'first', content: 'Content 1'}, {title: 'second', content: