import React, { useState } from "react";import {BrowserRouter as Router, Switch, Route, Link, Prompt} from "react-router-dom";export default function PreventingTransitionsExample() { return ( Form One Two } /> One} /> Two} /> );}function BlockingForm() { let [isBlocking, setIsBlocking] = useState(false); return (
Blocking?{" "} {isBlocking ? "Yes, click a link or the back button" : "Nope"}
{setIsBlocking(event.target.value.length > 0);}} />
Submit to stop blocking