Click on pictures of different genders
P粉122932466
P粉122932466 2023-09-14 22:23:30
0
1
589

How to click on a men's or women's clothing image to open a different clothing product on another page in ReactJS using React Router? I searched on Google and found nothing.

I am using the map to cycle through each men's or women's clothing product.

P粉122932466
P粉122932466

reply all(1)
P粉587780103

The following example may help you solve the problem:

import React from 'react';
import { BrowserRouter as Router, Route, Link } from 'react-router-dom';

const App = () => {
  return (
    <Router>
      <div>
        <nav>
          <ul>
            <li>
              <Link to="/mens-clothing">Men's Clothing</Link>
            </li>
            <li>
              <Link to="/womens-clothing">Women's Clothing</Link>
            </li>
          </ul>
        </nav>

        <Route path="/mens-clothing" component={MenClothingPage} />
        <Route path="/womens-clothing" component={WomenClothingPage} />
      </div>
    </Router>
  );
};

export default App;
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template