?? ??? ?? ? ??? ??????
???1. ??? ???(#/index/login)? this.state.isLogin? ???? ??? ??? ?????.
2. ?? ?? ???(#/index/passbook)? ???? ?? UI ????? ????? ???? ?? ??? ???(#/index/login)? isLogin? ?????. ??? ???? ??????
光陰似箭催人老,日月如移越少年。
react-router
???? ??? url
?? query
? ?? ??? ??? ??? ? ????? ?? ?????. react-router
傳遞參數無非通過url
里面的動態(tài)匹配或者query
來進行傳遞,這個文檔中都很清楚。
但在這種登錄態(tài)的場景中,更好的做法不是通過cookie
來進行登錄態(tài)的確定,從而使域名下的任何一個網頁都能知道已經登錄,而不需要像這樣傳遞state
??
? ???? ?? ????. ??? ??? ?? ??? ?? ?????? ??? ?????? ??? ? ? ???, ?? ?? state
? ??? ??? ????. #????#? ?? ??:
? ??: ??? redux ??? ?? ??? ?? ??? ?? ??? ?? ???? ?,
? ??: ???? ??(?? ??) ?? , ?? A?? ?? B? ???? ?? ?? B ?? ??? ?? A?? ???? ???? ???. ??? ? ? ????:
??? ????? this.props? ???? ??? ??? ?? ??? ?????.
redux/flux? ???? ??? ??? ????
cookie/LocalStorage/SessionStorage? ???? ??? ??? ??? ?????.
??? ??? ???? ?? ?? ??? ??? ??? ????? ????
react-redux? ???? ?? ?? ????? ???? ??? ? ? ?? ????? ???? ???? ????? props? ??? ? ????