react-router : share state between Routes without Redux

后端 未结 2 1070
失恋的感觉
失恋的感觉 2021-01-01 05:05

I would like to have a shared state (list of clients fetched remotely) between 2 sibling Routes : Timesheets and Clients.
I want to try how far

2条回答
  •  误落风尘
    2021-01-01 05:47

    You can take a look at reacts Context. Redux also makes use of Context. It allows you to pass some data down to all children. But you should write code to use this data, for instance you have determine contextTypes etc.

    You can see details on docs about how to use it.

提交回复
热议问题