in Navbar I have on "Skills Section" an onClick event. When I click on "Skills", onClick works, but it stops the page from jumping to section.
TSX Navbar:
const [skillsClicked, setSkillsClicked] = useState<boolean>(false);
const handleClickSkills = () =>{
setSkillsClicked(!skillsClicked);
}
<a href="#skills" >
<li onClick={handleClickSkills}>Skills</li>
</a>
TSX Skills:
const {skillsClicked, handleClickSkills} = useGlobalContext();
return (
<section>
<div>
<ul id='skills'></ul>
</div>
</section>
)
I want when I click on "Skills", the onClick event to change the state and in the same time to jump on the section based on the ID. (Separately they both work fine)