Python Return Function From Useeffect