Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to React Router (MERN 2.6) #399

Open
mannyhenri opened this issue Oct 15, 2018 · 6 comments
Open

Upgrade to React Router (MERN 2.6) #399

mannyhenri opened this issue Oct 15, 2018 · 6 comments
Assignees
Milestone

Comments

@mannyhenri
Copy link
Contributor

Main thread related to upgrading to MERN 2.6 (react router 4)

@mannyhenri mannyhenri added this to To do in MERN Roadmap via automation Oct 15, 2018
@mannyhenri mannyhenri added this to the 2.6.0 milestone Oct 15, 2018
@mannyhenri
Copy link
Contributor Author

@ashifa454 here is where we can track ongoing issues with React router upgrade (2.6)

@ashifa454
Copy link

ashifa454 commented Oct 15, 2018 via email

@ashifa454
Copy link

can you guide me why we are using match in server.js, what is the alternative for it in V4

@mattlubner
Copy link
Contributor

@ashifa454 I don't believe there's a direct equivalent for match on the server. We'll have to use a <StaticRouter /> and pass in context and location, then after calling renderToString() we can check for context.url and handle redirects that way.

I'm not completely sure about errors, but I'm guessing wrapping the whole thing in a try-catch or Promise should suffice for handling render errors.

You can read a bit more about it here: https://reacttraining.com/react-router/web/guides/server-rendering

@ashifa454
Copy link

i am following the official docs and have resolved the match thing, just trying to fix checksum, for server and client

@Amdadullah-Raihan
Copy link

Hi there- Was this issue solved? if not I want to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
MERN Roadmap
  
To do
Development

No branches or pull requests

4 participants