Answers for "react on submit direct to new page"

6

redirect onclick react

import React from 'react';
import { useHistory } from "react-router-dom";

function Home() {
  const history = useHistory();
  
  const handleRoute = () =>{ 
    history.push("/about");
  }
  
  return (                     
          <Button
            onClick={handleRoute}>
              About
          </Button>
  );
}
export default Home;
Posted by: Guest on December-16-2020
0

send props from one component to another on button click

<div>
<button>View Order</button>
    <p><span>{this.props.orderno}</span> 
    <span>{this.props.title}</span></p>
    <p>{this.props.entity} - {this.props.po}</p>
    <p>Due {this.props.duedate}</p>
</div>
Posted by: Guest on December-23-2020

Code answers related to "react on submit direct to new page"

Code answers related to "Javascript"

Browse Popular Code Answers by Language