useState not evaluating after history.push