useRef(3)
-
css, routing, form
Routing10_action함수1_Form태그서버전송2_예외처리_useActionData이용 import React from 'react'; import Home from './pages/Home' import Products from './pages/Products' import Root from './pages/Root'; import UsersRoot from './pages/UsersRoot'; import NewUser from './pages/NewUser'; import Error from './pages/Error'; import ProductDetails from './pages/ProductDetails'; import ProductDetails2 from './pages/Produc..
2024.03.24 -
useRef
input관리매번랜너링문제해결 import { useState, useRef } from "react"; //////////////// export default function Player() { const username = useRef(); const age = useRef(); //태그 중 ref={playerName}을 참조함 ////////////////////state와 다르게 값을 변경해도 재랜더링 되지 않고, current 속성을 사용 const [inputs, setEnterdPlayerName] = useState({username:"", age:""}); //button 을 클릭했을 때만 재랜더링 됨 , 효율적임 function handleClick() { var new_inputs..
2024.03.19 -
useState 와 useRef
GameBoarder import React, { useState } from 'react'; import "./GameBoarder.css" const initialGameBoard=[ [null, null, null], [null, null, null], [null, null, null], ] // const[gameBoard, setGameBoard] = useState(initialGameBoard); function GameBoarder() { const[gameBoard, setGameBoard] = useState(initialGameBoard); function handleSelect (rowIndex, colIndex){ //1.방법 (베열에 변경사항이 저장되나 동일한 주소값이기 때문에 ..
2024.03.19