how to pass object in history.push code example
Example 1: how to get state value from history react
this.props.location.customNameData // it is equal to yourData
Example 2: how to get state value from history react
history.push('/path', yourData);