react-router-v4

    1熱度

    1回答

    我不明白我做了什麼不正確。 請幫忙。 我需要通過點擊導航到反應路線另一條路線4. 我看到了類似的問題在這裏:How to get history on react-router v4? ,並作出一切爲正確的答案寫,他們的反應不會呈現我的組件。 貝婁是我的代碼: import history from './history'; const store = createStore(redu

    2熱度

    1回答

    我正在用React構建一個網站,並使用React-Router,當用戶訪問一個不存在的URL時,我想渲染一個404頁面。 某些URL是動態的,也就是說, www.site.com/user/(username) 如何渲染反應路由器404頁,如果與一個特定的用戶名犯規的用戶存在嗎?在API調用期間,我是否必須手動在組件本身編寫代碼來檢查用戶是否存在,然後將用戶重定向到404組件? 我正在尋找將用

    1熱度

    1回答

    我使用react-router-v4,react-bootstrap,react-router-bootstrap創建一個應用程序,所以我有一個LinkContainer點擊我去新頁面,但我想從現有頁面的一些數據到新頁面。什麼是最好的方式來做到這一點?我無法通過網址傳遞每個數據。 這裏是誰在這部分我有一年的頁面 <LinkContainer to="/mix" className="btn btn

    1熱度

    1回答

    我想使用react和react-router-dom來訪問我的應用程序導航上的匹配參數。這裏是一個簡單的例子,我做了一個代碼,你可以在主題組件上看到我在組件級別獲得正確的匹配,但不在導航欄中,我在位置道具中獲得正確的url路徑,所以我不是當然,如果我這樣做是正確的。 This would be the working snippet,因爲我無法將react-router-dom添加到堆棧溢出片段。

    0熱度

    1回答

    我正在使用React Router 4,並沒有通過嵌套的Switch組件進行路由。這裏是我的路線: const routes = ( <div> <Switch> <Route exact path="/" > <Switch> <Route path="/test" component={Test} /> <Route pat

    0熱度

    1回答

    我有一個路徑的文件,按預期工作: <Route path="/app" render={({match}) => ( <Switch> <Route exact path={`${match.url}/`} component={Home} /> <Route path={`${match.url}/error`} component={Error} />

    0熱度

    1回答

    <Router history={history}> <Switch> <Route exact path="/" render={() => ( AUTH ? ( AUTH == "1" ? <NormalPage /> : <AdminPage /> ) : (

    1熱度

    1回答

    在反應路由器(4.1.2),我有以下途徑呈現: <Route path="/organisations/:organisationId/profiles" component={MapContainer} /> 裏面我MapContainer我得到的organisationId通過this.props.match.params.organisationId 此預期MapContainer組件也

    1熱度

    1回答

    給出以下內容; let render =() => { const routes = require('./routes/index').default(store) ReactDOM.render( <AppContainer store={store} routes={routes} />, MOUNT_NODE ) } // ==========

    0熱度

    1回答

    當我以編程方式嘗試更改視圖時,它只會更改url,而不會查看。 我有什麼: import createHistory from 'history/createBrowserHistory'; const history = createHistory(); 我綁定點擊收聽到一些ELEM: <div onClick={this.navigateMeToHome}>To Home</div>