React.memo1 3. React.js props 리액트 js props 리액트에서 부모컴포넌트에서 자식컴포넌트로 데이터를 보내야할때. ex. 버튼 스타일을 한개의 컴포넌트에 저장해놓고 안에있는 텍스트 값만 바꿀때 const root = document.getElementById("root"); function Btn(props) { return ( {props.text} ) } function ConfirmButton() { return ( Confirm ) } const MemorizedBtn = React.memo(Btn); function App() { const [value, setValue] = React.useState("Save Changes"); const changeValue = () => setValue (" Revert Change.. 2024. 2. 14. 이전 1 다음