higher-order-components

    1熱度

    1回答

    我試圖圍繞高階組件包裝我的頭,這些與Redux容器組件相同。另外推薦的方式是通過擴展React.Component的類或者在redux站點中沒有的類來編寫更高階的組件(容器組件)。

    3熱度

    1回答

    首先是一些上下文。 我正在使用Redux來管理我的應用程序的身份驗證狀態,並將Auth作爲Redux容器(或智能組件)。 我創建了一個包裝(高階組件),其採用Auth並返回: export default function AuthWrapper(WrappedComponent) { class Auth extends Component { ... <Auth stuff