-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Closed
Description
Ever since I added custom Express server to handle clean URLs, withRouter HOC doesn't inject props.router.
Navigating FROM a page where withRouter is not used, TO a page withRouter, router prop is present, however, if the page is refreshed, the router prop is gone.
This is my current server.js setup for the clean urls.:
server.get('/c/learn/:courseSlug/:lessonSlug', (req, res) => {
const actualPage = '/course/learn';
const queryParams = {
courseSlug: req.params.courseSlug,
lessonSlug: req.params.lessonSlug
};
app.render(req, res, actualPage, queryParams);
});How to user withRouter and Router methods with clean URLs?
Metadata
Metadata
Assignees
Labels
No labels