two buttons named Buyer and Seller. So if I select buyer or seller it will navigate to page 1 and there is a submit button. . But if I've selected buyer then it will navigate to page 2 on submit and if I've selected seller then it will navigate to page 3. How can i do this?
In how many groups did u send this
state ={ selected: "seller" } //On button click change state <Link to= {`/${this.state.selected}`}> submit button </Link>
history.push() takes an optional second argument that you can use to store location-specific state as an object, e.g. { from: 'buyer' }. You can then access this data on location.state for your custom navigation logic elsewhere.
Обсуждают сегодня