window.requestAnimationFrame() is mostly for animation optimization on browser. Your can read more about it here: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
But I don't think it could help you with your issue. From what I understand your problem is with your react components.
Here is an example of a possible implementation of your architecture: https://jsfiddle.net/snahedis/69z2wepo/28572/
var Master = React.createClass({
increment: function() {
this.refs.counter.increment();
},
render: function() {
return (
<div>
<Counter ref="counter" />
<Logic increment={this.increment} />
</div>
);
}
});
var Logic = React.createClass({
render: function() {
return <button onClick={this.props.increment}>increment</button>;
}
});
var Counter = React.createClass({
getInitialState: function() {
return {
counter: 0
};
},
increment: function() {
this.setState({
counter: this.state.counter + 1
});
},
render: function() {
return <div>{this.state.counter}</div>;
}
});
ReactDOM.render(
<Master />,
document.getElementById('container')
);
Obviously the increment method on the Logic component could be triggered with something else that a click on a button.
However, this structure is a bit strange. If it's possible I would recommend to change it. Logic component would become the parent of the Counter component rather than his sibling.
Here is the example: https://jsfiddle.net/snahedis/69z2wepo/28573/
var Master = React.createClass({
render: function() {
return (
<div>
<CounterLogicWrapper />
</div>
);
}
});
var CounterLogicWrapper = React.createClass({
getInitialState: function() {
return {
counter: 0
};
},
increment: function() {
this.setState({
counter: this.state.counter + 1
});
},
render: function() {
return (
<div>
<Counter counter={this.state.counter} />
<button onClick={this.increment}>increment</button>
</div>
);
}
});
var Counter = React.createClass({
render: function() {
return <div>{this.props.counter}</div>;
}
});
ReactDOM.render(
<Master />,
document.getElementById('container')
);