Open ildevelop opened 4 years ago
up?
I have the same question; we can either import push
from connected-react-router
, or useHistory
from react-router-dom
, but what would be considered best-practice?
在home页面,当我在redux里面使用dispath(push('/about'))想切换到about页面。页面url变成了about,但页面home页面没更新。useHistory 查看pathname还是home的,没有变成about。 项目用了history和connected-react-router。 不想写英文,这是为啥呢
Up?
I work with
react-router-dom
and wanna useconnected-react-router
may I use useHistory instead add 2 libraries [ hisrory, react-router ] to my project ?