简体   繁体   中英

How react-router send request to server middleware from client?

I want to understand this code : How does react-router work with an isomorphic app, (server and client side routing). How react-router on client side can send request to middleware on the server ?

Link to react-router

How react-router on client side can send request to middleware

It doesn't send requests to server.

React router is responsible (From docs):

React Router keeps your UI in sync with the URL

Please check this https://github.com/rackt/react-router/blob/latest/docs/Introduction.md and first section Without React Router . It shows what react-router replace.

react-router changes browser url. But this doesn't make calls to server. For communicate with server you can use jquery ( http://api.jquery.com/jquery.ajax/ ) or superagent ( https://github.com/visionmedia/superagent ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM