Why React.memo did not help
Child is wrapped in React.memo, but it still re-renders every time Parent renders. What is the most likely reason?
function Parent() {
const [n, setN] = useState(0)
const options = { sort: "asc" }
return <Child options={options} onPick={() => setN(n + 1)} />
}Discussion 0
Join free to post in the discussion.
Related questions
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- Invisible text while fonts loadFrontend Developer
- Smaller image filesFrontend Developer
- What JSX turns intoFrontend Developer
- A component written in lowercaseFrontend Developer
- Adding a CSS class in JSXFrontend Developer