Koajs and react developed, how to control routing?
Because koa and react both handle routing, but koa has more rights, such as
React processing’ /user’
However, koa has no special treatment for’ /user’, namely 404
At this time, direct access to’ /user’ will result in 404, but not react processing results
What about this kind of situation?
You can use route matching in react server rendering, and there is a match method in react-router.
You can have a lookhttps://github.com/zhanfang/koa-react-weixinI don’t think it is necessary to do this for the annotated code. Another way is to refer to the code in the link for my current practice.