add state to history.push react code example Example: how to get state value from history react this.props.location.customNameData // it is equal to yourData