I am using useProductContext() in index.jsx in src. It returns ‘undefined’ the first time around and then it provides the correct value. Can someone tell me 1) why is useProductContext giving ‘undefined’ as the value the first time and 2) why is the function being called several times over…?
Thank you.