使用反应路由器
答
这工作: 给<RouteHandler/>
一个引用,就像这样:<RouteHandler ref="routerHandler"/>
然后调用这样的: this.refs.routerHandler.refs.__routeHandler__.someFunctionOnActiveRoutesHandler()
任何想法的反应路由器2.X相当于这是什么? –
React路由器2.0为您提供this.props.children。使用这种方法来获得一个ref:http://stackoverflow.com/questions/29568721/getting-dom-node-from-react-child-element,并且这种方法调用一个函数:https://facebook.github。 IO /反应/提示/暴露组分-functions.html。请记住这是一种反模式。 – user2827377