일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
- evm
- JavaScript
- middleware
- solidity
- node.js
- useState
- blockchain
- built in object
- nextJS
- error
- tailwindcss
- API
- hardhat
- concept
- web
- typeScript
- REACT
- 삶
- Redux
- CSS
- SSR
- CLASS
- graphQL
- bitcoin
- 기준
- HTML
- Ethereum
- express.js
- Props
- Interface
- Today
- Total
목록React.memo (3)
ReasonJun
React.memo To fix the comparison method used by React.memo for prop comparison, you can provide a custom comparison function as the second argument to React.memo. This custom comparison function determines whether the component should be re-rendered by comparing the previous props with the next props. The custom comparison function receives two arguments: prevProps and nextProps. It should retur..
React.memo is a higher-order component (HOC) provided by React that aims to optimize functional components by preventing unnecessary re-renders. It is similar to the PureComponent class component optimization but designed for functional components. By wrapping a functional component with React.memo, React will automatically memoize the component and only re-render it if its props have changed. I..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bUYnkk/btsjIK47yfM/697YhICMCI2sgJaftNZNd1/img.png)
App.js code : import { useEffect, useState } from 'react'; import './App.css'; import B from './components/B'; import A from './components/A'; function App() { const [value, setValue] = useState(''); const [posts, setPosts] = useState([]); useEffect(() => { fetch('https://jsonplaceholder.typicode.com/posts') .then((res) => res.json()) .then((posts) => setPosts(posts)); }, []); return ( setValue(..