score:1

Accepted answer

The setActiveView prop value you pass to NewPaymentWidgetFooter is () => setActiveView(), which will always call setActiveView without any parameters. If you pass it a function that calls setActiveView with its parameter, like this

<NewPaymentWidgetFooter ref={footerRef} setActiveView={(n) => setActiveView(n)}/>

it should use the value you pass to the callback.


Related Query

More Query from same tag