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

Router changes url link but not the view when using react router dom #4

Open
sloorush opened this issue May 25, 2020 · 31 comments · Fixed by #21
Open

Router changes url link but not the view when using react router dom #4

sloorush opened this issue May 25, 2020 · 31 comments · Fixed by #21

Comments

@sloorush
Copy link

No description provided.

@Nazeh-Taha
Copy link
Owner

I think this article will help you.
https://codeburst.io/getting-started-with-react-router-5c978f70df91

@ILoomans
Copy link

ILoomans commented Jul 3, 2020

I love the design for the navbar but I am having the same issue, i had a working navigation bar, once i replaced it with this one i had the same issue that the url link changes but the view doesn't.

@sloorush
Copy link
Author

sloorush commented Jul 3, 2020

yep same

@Nazeh-Taha
Copy link
Owner

Thanks for contacting me. I want to ask if you used "react-router-dom" in your project.

@sloorush
Copy link
Author

sloorush commented Jul 4, 2020

yes, this package https://www.npmjs.com/package/react-router-dom

@Nazeh-Taha
Copy link
Owner

Can I see the repo or the code

@ZachPfeifer
Copy link

Did this issue get resolved? I have the same problem where it will change the URL but not the view. My original Router Links work just fine but the navbar isn't working. I'll link my repo but you won't be able to clone and host without my keys.

Repo:
-https://github.com/ZachPfeifer/silver-spirit-alchemy/blob/master/client/src/components/NavBar/Navbar4.js

@Nazeh-Taha
Copy link
Owner

Did this issue get resolved? I have the same problem where it will change the URL but not the view. My original Router Links work just fine but the navbar isn't working. I'll link my repo but you won't be able to clone and host without my keys.

Repo:
-https://github.com/ZachPfeifer/silver-spirit-alchemy/blob/master/client/src/components/NavBar/Navbar4.js

ok try this:
import the react-router like this:
import { BrowserRouter as Router, Route } from "react-router-dom";
then but this:




......

and remove all (exact) from all routes except home route.

@Nazeh-Taha
Copy link
Owner

Did this issue get resolved? I have the same problem where it will change the URL but not the view. My original Router Links work just fine but the navbar isn't working. I'll link my repo but you won't be able to clone and host without my keys.
Repo:
-https://github.com/ZachPfeifer/silver-spirit-alchemy/blob/master/client/src/components/NavBar/Navbar4.js

ok try this:
import the react-router like this:
import { BrowserRouter as Router, Route } from "react-router-dom";
then but this:

......
and remove all (exact) from all routes except home route.

    <Router>
      <Route path="/" component={Home} exact />
      <Route path="/about" component={AboutUs} />
      <Route path="/cart" component={Cart}/>
    </Router>

@ZachPfeifer
Copy link

ZachPfeifer commented Jul 6, 2020

The issue persists and I only have problems with the navbar. I have buttons that work just fine using the react-router-dom .

Here is the condensed version of my App.js:

import React from 'react';
import { BrowserRouter as Router, Route } from "react-router-dom";
<Router> <Route exact path="/" component={Home} /> <Route path="/store" component={Store} /> <Route path="/store/:payload" component={SingleProduct} /> <Route path="/about" component={AboutUs} /> <Route path="/cart" component={Cart} /> <Route component={Error} /> </Router>

@JevF1982
Copy link

JevF1982 commented Jul 7, 2020

Very nice navbar , but I have indeed the same problem with react-router...

@Nazeh-Taha
Copy link
Owner

Hi guys, sorry if there is a problem in the navbar just give me two days and I will fix it.
thanks a lot for using this package and thanks for contacting me.
I will tell you when I finish fixing it.

@umar834
Copy link

umar834 commented Jul 25, 2020

Loved the design but facing the same issue.. :(

@ghost ghost mentioned this issue Jul 27, 2020
@ghost
Copy link

ghost commented Jul 27, 2020

I created a PR that resolved this issue for me on mobile devices.

@hernandez87v
Copy link

Really nice Navbar but having the same issue with react-router-dom
<Router> <div className="App"> <Navbar /> <Route path="/" exact component={Twitch} /> <Route path="/Twitch" exact component={Twitch} /> <Route path="/Soundcloud" exact component={Soundcloud} /> <Route path="/Mixcloud" exact component={Mixcloud} /> </div> </Router>

On a side note anyway to just have text instead of a logo?

@dawood6
Copy link

dawood6 commented Sep 13, 2020

Same Issue Again Any Help

@dawood6
Copy link

dawood6 commented Sep 13, 2020

Hi guys, sorry if there is a problem in the navbar just give me two days and I will fix it.
thanks a lot for using this package and thanks for contacting me.
I will tell you when I finish fixing it.

bro I like the design but not using it because of navigation issue

@danielro8
Copy link

Yes, I have the same problem.
A pity because it's an awesome design.

@christorepl
Copy link

the pull request didn't seem to change anything, neither did the advice given by the owner. such a shame, it's a really simple navbar to setup. i hope to see it fixed soon!

@mohanor
Copy link

mohanor commented Dec 26, 2020

i have the same problem

@lorstenoplo
Copy link
Contributor

I have fixed the page change bug in PR : #21

@lorstenoplo lorstenoplo mentioned this issue Jan 4, 2021
@pr7prashant
Copy link

I have fixed the page change bug in PR : #21

@Nazeh-Taha are you planning to publish this to the NPM registry soon ?

@lorstenoplo
Copy link
Contributor

@pr7prashant
It should not happen yet I guess, because there are some small css positioning issues of the
navbar and gsap related issues

@pr7prashant
Copy link

Thanks @lorstenoplo
I also noticed that the navbar is not sticky on top for mobile devices. Can I create a feature request for this ?

@lorstenoplo
Copy link
Contributor

@pr7prashant yeah you can

@karlaluuu
Copy link

has anyone made it work? i added the component, as well as the route under. still not working

@lorstenoplo
Copy link
Contributor

lorstenoplo commented Jan 22, 2021

@karlaluuu Did you install the package using npm or yarn from the registry

@karlaluuu
Copy link

@lorstenoplo did use npm. i'll try reinstalling the package and see

@lorstenoplo
Copy link
Contributor

lorstenoplo commented Jan 22, 2021

@karlaluuu Don't there is no use because he ( @Nazeh-Taha ) hasn't published the latest version to the npm registry.

You can either wait for the latest release or
Clone this repository instead ( #23 actually ) then :

  1. Run npm install in the right directory
  2. Run npm run build
  3. Copy the dist folder generated by the build command
  4. Now go to the directory where your project is located
  5. Navigate to node_modules > react-responsive-animate-navbar then replace the existing dist folder with the newly generated one

@karlaluuu
Copy link

hey, sorry for the late response. thank you, @lorstenoplo! made it work!

anyways, very good design as well. kudos!!!!

@karlaluuu
Copy link

@karlaluuu Don't there is no use because he ( @Nazeh-Taha ) hasn't published the latest version to the npm registry.

You can either wait for the latest release or
Clone this repository instead ( #23 actually ) then :

  1. Run npm install in the right directory
  2. Run npm run build
  3. Copy the dist folder generated by the build command
  4. Now go to the directory where your project is located
  5. Navigate to node_modules > react-responsive-animate-navbar then replace the existing dist folder with the newly generated one

question. is there any timeline to get the latest version out in the npm registry? just realized that this method works locally, but not being catched by my site deployed in a web hosting company. anyone using netlify to host their site and made it work? :(

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

Successfully merging a pull request may close this issue.