Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

apply back button to a react component

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

export const Item = () => {
    let history = useHistory();
    return (
        <>
          <button onClick={() => history.goBack()}>Back</button>
        </>
    );
};
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #apply #button #react #component
ADD COMMENT
Topic
Name
9+2 =