react-static: Rehydrate fails when using withRouteData

Related to #567. Using version 5.9.1 hitting a route thats using the withRouteData HOC with index.html on the end fails with error RouteData or withRouteData couldn't find any props for path: [path]. You are either missing a route.getData function or you are relying on RouteData/withRouteData where you don't need to..

Steps to Reproduce the problem

  • react-static create (use basic)
  • yarn build
  • yarn serve
  • Hit http://localhost:3000/blog/index.html

Expected Behavior

Should rehydrate the html.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

This should be fixed in 6.1.5

Looks like a bug where the templateIndex for 404 pages is not set correctly and ends up trying to load a different template on a 404 hit. If that template uses RouteData or withRouteData in any way, you will get this error. I’m working on a fix right now.