React-Router onChange hook

前端 未结 2 1150
情书的邮戳
情书的邮戳 2021-02-08 03:34

I am having issues getting the onChange hook in react-router to work properly. Here is my routes file:

import React from \'react\';
import { Router, Route, brows         


        
2条回答
  •  北海茫月
    2021-02-08 04:11

    onUpdate needs to be declared on the Router instance not Routes. Although, Routes can declare onChange and onEnter hooks - it's probably what you were looking for.

提交回复
热议问题