我有一個不屬於任何其他組件的組件。當用戶點擊鏈接時,頁面將跳轉到該鏈接,該鏈接通過react-router實現。React.js:從獨立組件訪問整體應用程序狀態
<Link to={`/weather-stations/${this.props.active_device}`} >view detail
</Link>
我不能找到一種方法,應用程序的狀態傳遞給組件,如:<ComponentName data={ this.state }/>
我不知道什麼是推薦的方式來做到這一點的反應是?謝謝。
? http://facebook.github.io/react/docs/context.html – ezakto