Commit be0a7340 authored by kusang96's avatar kusang96
Browse files

href 처리중

parent 96d53c8a
......@@ -18,10 +18,9 @@ function App() {
return (
<div>
{console.log("match.params=",match.params(product))}
<Router>
<MainNav />
<SubNav />
<Router>
<Switch>
<Route exact path="/" component={Home} />
<Route path="/login" component={Login} />
......
import React, { useState, useEffect, useRef } from 'react';
import { Redirect } from 'react-router-dom';
import { Navbar, Nav, NavDropdown } from 'react-bootstrap';
import { Link } from 'react-router-dom';
import { Navbar, Nav } from 'react-bootstrap';
import axios from 'axios';
import catchErrors from '../utils/catchErrors';
......@@ -16,7 +16,7 @@ function SubNav() {
Object.keys(response.data[0]).forEach((ele) => {
const url = ele.toLowerCase()
list.push(
<Nav.Link href={`/product/${url}`}>{ele}</Nav.Link>
<Nav.Link as={Link} to={`/product/${url}`}>{ele}</Nav.Link>
)
})
setCategorysDiv(list)
......
......@@ -2,7 +2,8 @@ import React, { useState, useEffect, useRef } from 'react';
import Pagination from '../Components/Pagination';
import { Container, Row, Col, Form, FormControl, Button, Card, Dropdown } from 'react-bootstrap';
function ProductsList() {
function ProductsList(props) {
const
const [sub, setSub] = useState(['PADDED JACKET', 'JACKET', 'JUMPER', 'COAT', 'FLEECE', 'CARDIGAN / VEST'])
// useEffect(() => {
......@@ -25,7 +26,7 @@ function ProductsList() {
return (
<div>
{console.log("match.params=",props.match.params.product)}
<style type="text/css">
{`
.btn {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment