How to optimize PreRender to React?

Hi all. Can you guys tell me how to optimize, what would PreRender was only in the case if you have changed your prop cDOptions?
https://codepen.io/Delphia_Dietrich/pen/xxwbKOm
Tried these ways, but failed:
const memoizedCallback = useCallback(
 () => {
setCDOptions(setOptions())
},
[cDOptions]
)
return memoizedCallback

const memoizedValue = useMemo(() => setCDOptions(setOptions()), [cDOptions])
return memoizedValue
April 19th 20 at 12:19
0 answer

Find more questions by tags React