Hi there in the challenge mentioned
Advanced React useMemo() lesson challenge
The Instant Feedback accepts as correct answer the snippet below:
const sortedProducts = React.useMemo(() => {
return [...productsData].sort(
(a, b) => a.name.localeCompare(b.name)
)
}, [sort])
while as Bob (the teacher) explains later the real answer is the snippet:
const sortedProducts = React.useMemo(() => {
return [...productsData].sort(
(a, b) => a.name.localeCompare(b.name)
)
}, [productsData])
Just wanted to let you know.
Thanks