用history.push,和history.go或者replace其他方式去改變當前的location有什么特別的區別
history.push 這個方法會向history棧里面添加一條新記錄,這個時候用戶點擊瀏覽器的回退按鈕可以回到之前的路徑。
history.go 這個方法的參數是一個整數,意思是在 history 記錄中向前或者后退多少步,類似 window.history.go(n)
history.replace 跟 history.push 很像,唯一的不同就是,它不會向 history 添加新記錄,而是跟它的方法名一樣 —— 替換掉當前的 history 記錄。
開發和生產變量
- 參考文章
- 環境變量必須要REACT_APP_開頭, 才能在process.env中取值
- REACT_APP_ENV在antd已經定義在了src/typings.d.ts中