鍍金池/ 問(wèn)答/HTML/ react history 傳遞參數(shù) mach找不到

react history 傳遞參數(shù) mach找不到

react history.push(path,state) 傳遞的參數(shù)在match里找不到,只能在location.state里面找到這是為什么??

回答
編輯回答
黑與白

因?yàn)?a rel="nofollow noreferrer">match里面本來(lái)就沒(méi)有包含state。

match里面只包含了route path如何匹配URL的信息,而state顯然不是。

2017年9月5日 04:00
編輯回答
哚蕾咪
2018年5月11日 05:31