How to fix useImperativeHandle second argument must be a function that returns the handle in React | DevErrors