React: Server side redirects that rely on data fetching. #801

Closed
opened 2025-08-09 17:17:43 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @andrewl913 on 4/25/2017

I am currently hitting bottleneck with handling server side redirects that require a DB fetch to get the resolved redirect location. The naive approach was making a request in the onEnter of the matched route. With this method, the store will be configured and renderToString will be called 3 times with 2 of those times occuring before the domainTasks resolve. I have a workaround that uses function generators, but I figured there is a better method of doing this.

*Originally created by @andrewl913 on 4/25/2017* I am currently hitting bottleneck with handling server side redirects that require a DB fetch to get the resolved redirect location. The naive approach was making a request in the onEnter of the matched route. With this method, the store will be configured and renderToString will be called 3 times with 2 of those times occuring before the domainTasks resolve. I have a workaround that uses function generators, but I figured there is a better method of doing this.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#801
No description provided.