Closed danielnuwin closed 6 years ago
Can you use Anchor link where the id is on another component? I cannot scroll to the id when the Anchorlink is on another component. Does it have to be on the same component to work?
Navbar.js component render() { return ( <div> <AnchorLink href='#section1'>section1</AnchorLink> <AnchorLink href='#section2'>section2</AnchorLink> <AnchorLink href='#section3'>section3</AnchorLink> <AnchorLink href='#section4'>section4</AnchorLink> </div> ); }
Home.js component render() { return ( <div> <Parallax strength={500}> <ScrollAnimation delay={1000} animateIn="fadeIn" animateOnce={true}> <CarouselIntro id="section1"/> </ScrollAnimation> </Parallax> </Parallax> <Parallax strength={500}> <BlogPage id="section2"/> </Parallax> <Parallax strength={500}> <ScrollAnimation animateIn="fadeIn" animateOnce={true}> <GalleryContainer id="section3"/> </ScrollAnimation> </Parallax> <Parallax strength={500}> <BlogPage id="section4" /> </Parallax> </div> ); }
Found Solution, I have to wrap my components in a div and set ID there instead.
Can you use Anchor link where the id is on another component? I cannot scroll to the id when the Anchorlink is on another component. Does it have to be on the same component to work?