0

I am a little confused, my navbar is a component as are my other sections. How do i add a scrollToView on it. I don't understand where the function goes. Can somebody help me ? I tried using useRef and another npm package. And, it didn't work.

Here is my code...

Index.js

export default function Home () {

return 
(

<Nav/>

<Services/>
)


}

Nav component

function Nav () {
    
  
  return (

<div>
  <title>About</title>


<ul  className="nav justify-content-end m-1 p-1 col-12 pe-auto">
   
  <li className="nav-item">
  <Link  href="About">
    <a  className="nav-link m-2 p-1 border border-dark pe-auto text-dark">About me</a>
    </Link>
  </li>
  
  <li className="nav-item">
    <Link href="/"> 
    <a className="nav-link m-2 p-1 border border-dark  text-dark">Services</a>
    </Link>
  </li>

Any ideas?

someone
  • 661
  • 1
  • 9
  • 26
  • Your intentions are not clear in your question. What exactly is the problem? And what are you doing that should be happening? – Alex Yepes Nov 06 '21 at 12:46
  • Apologies. I want to select services in the nav and then for it to scroll down to services component – someone Nov 06 '21 at 12:54
  • Essentially is it possible or do I need to have the nav elements in the index as opposed to having it as a component. – someone Nov 06 '21 at 13:04

0 Answers0