Php Use Variable In Anonymous Function In React