I'm using react-router v1.0.0-rc4.
Here is my routes:
<Router>
<Route path="/" component={App}>
<Route path="info" component={Info} />
<Route path="dashboard" onEnter={callAjax} component={Dashboard} />
</Route>
</Router>
When url change to /dashboard, onEnter will be called, an ajax request will send to server and about 1 second response time.
So in this 1 second, UI didn't have any response. What I want to ask is anything I can do for this?
What I'm trying to do is in dashboard component, I check the data is existed or not. If not exist, I will show spin, otherwise I will show data. But the issue is before the ajax complete, the dashboard will not be mounted.
So please give some suggestion, thanks.