kriasoft / universal-router

A simple middleware-style router for isomorphic JavaScript web apps
https://www.kriasoft.com/universal-router/
MIT License
1.71k stars 103 forks source link

API fetch calls #85

Closed AntonyKwok closed 7 years ago

AntonyKwok commented 7 years ago

Hi,

When using Universal Router with React Starter Kit, any API requests using either fetch or Axios (for example in routes/home/index.js) will call the API endpoint twice.

Any idea why?

Update March 25: The double call only happens when server-side rendering is called. Accessing the route client-side triggers a single API request.

frenzzy commented 7 years ago

This issue does not relate to the router, please take a look at: