Horje
change the route on button click react Code Example
navigating programatically react
import { Route } from 'react-router-dom'

const Button = () => (
  <Route render={({ history}) => (
    <button
      type='button'
      onClick={() => { history.push('/new-location') }}
    >
      Click Me!
    </button>
  )} />
)
change the route on button click react
class Login extends Component {
    nextPath(path) {
    this.props.history.push(path);
  }
    render() {
        return (
        <div>
        <button type='button' onClick={() => this.nextPath('/yourpath') } >Button</button>
        </div>
        );
}
        




Javascript

Related
First non repeating character position in a string Code Example First non repeating character position in a string Code Example
catch the last item in a array js Code Example catch the last item in a array js Code Example
jest test coverage Code Example jest test coverage Code Example
javascript check if link is clicked Code Example javascript check if link is clicked Code Example
string to number javascript & remove text Code Example string to number javascript & remove text Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7