I want to move to the area of my parents when I click on Nav's menu. I think the code is roughly right, but it doesn't work. also, I want to use useRef from react-hooks.
//nav.js
const Nav = ({ moveScroll }) => {
const handleMove = () => {
moveScroll.current.scrollIntoView({ behavior: 'smooth' });
};
return (
<Project to='' onClick={handleMove}>PROJECT</Project>
);
}
//app.js
const App = () => {
const moveScroll = useRef();
return(
<ProjectTitle ref={moveScroll}>Project</ProjectTitle>
);
}