Search
 
SCRIPT & CODE EXAMPLE
 

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>
        </>
    );
};
Comment

how to make back button react

const BrowserHistory = require('react-router/lib/BrowserHistory').default;

const App = React.createClass({
    render: () => {
        return (
            <div><button onClick={BrowserHistory.goBack}>Go Back</button></div>
        );
    }
});

React.render((
    <Router history={BrowserHistory}>
        <Route path="/" component={App} />
    </Router>
), document.body);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to let a function execute after 5 seconds javascript 
Javascript :: text to speech js 
Javascript :: random code js 
Javascript :: ion button transparent 
Javascript :: jquery on click get element 
Javascript :: nesting for loops 
Javascript :: image next src url 
Javascript :: get index pixel of canvas 
Javascript :: mongoose timestamps 
Javascript :: eslint allow debugger 
Javascript :: javascript pad number with leading zeros 
Javascript :: mongodb delete user 
Javascript :: get input value jquery 
Javascript :: javascript push item to beginning of array 
Javascript :: npm react-dom 
Javascript :: your company assigns each customer a membership id 
Javascript :: if window undefined 
Javascript :: flutter decoration image 
Javascript :: check if radio button is checked 
Javascript :: tailwind install nextjs 
Javascript :: slice until character javascript 
Javascript :: validators.pattern angular number 
Javascript :: how to call action from another module vuex 
Javascript :: coldfusion user defined function 
Javascript :: html tag run only after whole page is loaded 
Javascript :: neffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 
Javascript :: remove vowels from string javascript 
Javascript :: random string generator node js 
Javascript :: javascript string first letter lowercase 
Javascript :: jquery scroll to element 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =