Thank you @Rodrigo for your reply
Here's the best I could do: currentIndex is automatically inserted, but the wrapImg function returns nothing.
DEMO : https://stackblitz.com/edit/gsap-react-basic-f48716-ebgh4d?file=src%2FApp.js,src%2Fstyle.css,public%2Findex.html
I was inspired by this solution
https://codepen.io/GreenSock/pen/wvZjeGN