리액트(3)
-
Routing_loader
라우팅 메뉴링크활성화피드백_NaviLink이용 import React from 'react'; import { NavLink } from 'react-router-dom'; import classes from './MainNavigation.module.css' import { Link } from 'react-router-dom'; function MainNavigation(props) { return ( { return isActive ? classes.menu : undefined; }}> Home { return isActive ? classes.a : undefined; }}> products ); } export default MainNavigation; css a{ text-decoratio..
2024.03.24 -
axios, router
사용자추가1 import {useEffect, useState} from "react"; import {fetchUserList} from "./http.js" import UsersList from './components/UsersList' import Error from './components/Error'; import Box from "./components/Box.js"; export default function App() { const [usersList, setUsersList] = useState([]);//사용자 목록 const [isFetching, setIsFetching] = useState(false); //로딩중 상태저장값 const [error, setError] =useS..
2024.03.24 -
React
App.js //export default App; 를 넣거나 export default function App(){ 를 쓰기 import "./App.css"; function MyButton(){ //js코드 ==vue script 부분 //컴포넌트의 이름은 항상 대문자로 시작 return I'm a button //return vue== template 부분 } //arrow 함수 const MyButton2 = (props)=> { return I'm a button2 }; export default function App(){ return( Welcome to my app ); } //export default App; Button.js function MyButton (){ return but..
2024.03.17