-
Notifications
You must be signed in to change notification settings - Fork 27
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
Not compatible with this.props.history.push
?
#23
Comments
this.state.push
? this.props.history.push
?
It also doesn't seem to work with the |
Interesting, do you have an error in the developer console? Do you mind creating a small repository showing this issue? Thanks. Could you reproduce it using the examples? |
i'll send it on a zip. |
Steps to run:
|
I didn't receive an error in the console. Oopps. my bad. It's an outdated project that I sent you .. wait.. |
Thanks, I'll look at it tomorrow (too late here). |
Ok. thanks |
Your app doesn't build on my side:
I'll try to isolate the problem in one of my example. |
I wasn't able to reproduce the issue, I did the following test: diff --git a/examples/React-router/src/Components/Home.js b/examples/React-router/src/Components/Home.js
index ea57d48..57692f0 100644
--- a/examples/React-router/src/Components/Home.js
+++ b/examples/React-router/src/Components/Home.js
@@ -6,11 +6,13 @@ import Navigation from './Navigation';
const sleep = ms => new Promise(r => setTimeout(r, ms));
-async function Home() {
+async function Home(props) {
await sleep(1000);
const style = {backgroundColor: '#2196F3'};
+ props.history.push("/routeA")
+
return (
<div className="container">
<article className="box" style={style}> I was redirected to /routeA and saw the routeA component. Could you maybe try to reproduce it in the React-router example? |
do you have a gitlab account? I'll invite you. I've messed it up. Some hidden files with the prefix |
https://gitlab.com/sekiryuutei47/testproj/
p.s. A protected route is a route that only logged in user could access. |
Ow, it rendered probably because |
I would like to help you really but I need a way to reproduce easily your issue in order to fix quickly. Could you please reproduce the issue in my minimal React-router example available in this repo? |
I found this article, Links change URL but doesn't render component |
No, |
When going to another page using
this.props.history.push
, I can't seem to use this with aprotected route
stateless component which restricts the access of a page to a view when no user is logged in.The text was updated successfully, but these errors were encountered: