react native usehistory code example

Example 1: usehistory example

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

function Home() {
  const history = useHistory();
  return ;
}

Example 2: usehistory

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

function HomeButton() {
  let history = useHistory();

  function handleClick() {
    history.push("/home");
  }

  return (
    
  );
}

Example 3: usehistory

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

function HomeButton() {
  let history = useHistory();

  function handleClick() {
    history.push("/home");
  }

  return (
    
  );
}

Tags:

Misc Example