Python Return Function From Use Effect Component