-
Notifications
You must be signed in to change notification settings - Fork 41
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
Nav Links work only from homepage #184
Comments
having a look at this one |
Okay |
Okay so what I got to know after a little bit code reading is that Three solutions Let me know if you have another solution, Then I can start working on this issue |
I think first solution would add a lot of unnecessary code. I didn't quite get, what you suggested in third though. |
The third one was like this in the home page there are these section Home We can change the navbar content according to the page And the functionality for the button will be the same as home This was what i meant by the third point |
For now Working on the first solution then |
Can we use react scroll npm for this @Manvityagi di |
you could do something like this: const history = useHistory();
function handleClick(elementId) {
if (window.location.pathname !== "/") {
history.push(`/`);
let element = window.document.getElementById(elementId);
setTimeout(() => {
// wait for React to render component. maybe add a time-limit to this while loop as well
while (!element) {
element = window.document.getElementById(elementId);
}
element && element.scrollIntoView();
});
} then attach this event handler to |
Vahi dekh raha tha bhaiya thank you so much for this @abdus 🙌💯😆 |
No description provided.
The text was updated successfully, but these errors were encountered: