I’m feeling stupid cause i did the entire site but I’m stuck trying to make the navlinks scroll in the components of the same page.
My App.js
import Header from './components/Header';
import Intro from './components/Intro';
import Experience from './components/Experience';
import Skills from './components/Skills';
import Projects from './components/Projects';
import Arts from './components/Arts';
import Graduation from './components/Graduation';
import Footer from './components/Footer';
import styled from 'styled-components';
const AppContainer = styled.div`
width: 100%;
`;
function App() {
return (
<AppContainer>
<Header />
<Intro />
<Experience />
<Skills />
<Projects />
<Arts />
<Graduation />
<Footer />
</AppContainer>
)
}
export default App;
My Header
function HeaderMenu() {
return (
<ul>
<li><a href='#projects'>Projects</a></li>
<li><a href='#skills'>Skills</a></li>
<li><a href='#contact'>Contact</a></li>
</ul>
)
};
export default HeaderMenu;
What i already have tried and didn’t worked: use the hashtag (like html-css), "react-scroll", useRef.
2
Answers
Problem solved.
I needed to install this:
On App.Js
I put an id on every component i wanted to use.
On header
Hope it helps somebody new to React.
You can try
overflow-x: scroll;
doc: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x