react-boilerplate
react-boilerplate copied to clipboard
Use location instead of the undefined query property
Hi @richardscarrott,
I've found something which I consider a minor bug in your boilerplate. In the fetchComponentData
in the server.js
you are destructuring the renderProps
into query
, params
and history
. But query
is undefined. If I want to access the query parameters, I first have to get the location
property and then access the query
.
Hmm, interesting the checks fail for files I haven't touched.
@kyusu good catch... it also looks like history
is undefined.
There doesn't appear to be much in the way of documentation for renderProps
in the RR repo but I'm guessing it must have been removed when I upgraded to RR 3.x -- would you mind updating this to pass in just dispatch
, params
and the entire location
object, e.g.
const { location, params } = renderProps;
return (
component
.fetchData({
dispatch: store.dispatch,
location,
params
})
// Make sure promise always successfully resolves
.catch(() => {})
);
re: CI, it looks like there's a mismatched version of prettier -- if you make the above change I'll fix that up and merge it in.