Python Return Function From Use Effect React Not Working