0
I would like to call an id inside my html page
Type:
<a href="#meuid">Meu id </a>
<section id="meuid>
   Meu Id
</section>
No React
I’m trying like this:
header js.
    import { HashLink as Link} from 'react-router-hash-link'
    
    const Header = () => {
      return (
            <header id="header" className="header-transparent">
                <div className="container">
    
                    <div id="logo" className="pull-left">
                        <Link to="">
                            <img src="assets/img/logo.png" alt="" />
                        </Link>
                    </div>
                
    
                    <nav id="nav-menu-container">
                        <ul className="nav-menu">
                            <li className="menu-active"><Link smooth to="/">Home</Link></li>
                            <li><Link smooth to="/home#about">About Us</Link></li>
                            <li><Link smooth to="#services">Services</Link></li>
                            <li><Link smooth to="#portfolio">Portfolio</Link></li>
                            <li><Link smooth to="#team">Team</Link></li>                       
                            <li><Link smooth to="#contact">Contact Us</Link></li>
                        </ul>
                    </nav>
                </div>
            </header>
        )
    }
export default Header
home js.
import Header from '../../components/header';
const Home = () => {
    return (
        <div >
            <Header />
        
            <section id="hero">
                <div className="hero-container" data-aos="zoom-in" data-aos-delay="100">
                    <h1>Welcome to Regna</h1>
                    <h2>We are team of talented designers making websites with Bootstrap</h2>
                    <Link smooth to="#about" className="btn-get-started">Get Started</Link>
                </div>
            </section>
            <main>
               <section id="about">
                  <div className="container" data-aos="fade-up">
                      amount
                  </div>
                </section>
                <section id="services">
                    services
                </section>
        </div>
        );
    }
    
export default Home;
But the only place that works the anchor is the <section id="hero"> and the Header component does not work
How do I solve?
don’t need to use the other package! and also the question on the links doesn’t have the Hero tag? how were the tests
– novic
look here also has how to anchor: https://reactrouter.com/web/api/Link
– novic
Each a different id
– adventistaam
i did an example is it worked correctly with the additional package.
– novic
I think it should be the template I used, when I use hot Reload it doesn’t work using Angular, React or Vue
– adventistaam