-
Notifications
You must be signed in to change notification settings - Fork 258
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
Support for the new react-router 4 #116
Comments
react-router is the breaking change. This library should work fine with v3. |
I think I found a solution for this issue, that doesn't involve modifying the library. I have to test it thoroughly and make sure that it works in all scenarios so I don't get people hyped for no reason. I will post an update in the following week. |
@oprearocks any update on the solution? |
Oh. Totally forgot about this. My schedule has been hectic since then. Let me try to describe it in plain text, here. The problemThe problem with React Router is that it doesn't care about your query string anymore. This is why when you redirect to http://localhost:3000?token=token_string&uid=uid_string it all seems to go away. For me, this was an intermittent issue. Sometimes login worked, sometimes it did not. My guess is that every time it worked, React Router took more time to load, thus, the code monitoring the url change in the popup could kick in and parse the data from the query string. My solution
Here's the import React from 'react';
import { Redirect } from 'react-router-dom';
const RedirectRoute = ({ history, match }) => (
<Redirect to={{
pathname: '/',
search: `?token=${match.params.token}&uid=${match.params.uid}`
}}/>
);
export default RedirectRoute; As you can see, I'm using React Router's Let me know if this makes sense to you. |
the react-router has a lot of breaking changes.
The text was updated successfully, but these errors were encountered: