在反应路由器v4中使用''Getuserconfirmation'。它的用途是什么,没有这个差异?
const callbacks = (data) => {
console.log("callback consoled");
}
const getConfirmation = (message, callback) => {
console.log('heyyy');
const allowTransition = window.confirm(message)
callbacks(allowTransition)
}
class App extends React.Component {
render(){
return(
<Router getUserConfirmation={getConfirmation}>
<div>
<Link exact to = "/">home</Link>
<Link to = "/men">men</Link>
<Link to = "/women">women</Link>
</div>
</Router>
);
}
}