react-router

    0熱度

    1回答

    陣營Native- 路線「第一」應申報的屏幕,不知道!爲什麼會出現此錯誤? 請查看dir的附件截圖。 enter image description here import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-

    0熱度

    1回答

    我正在使用HOC組件來限制對未登錄用戶的路由訪問。這個HOC重新掛載子組件時掛載或重新呈現時,直接從url訪問此路線(在應用程序第一次加載時)的問題。例如,我在PaperWorkProgress組件中有3次did mount。 路由定義: <Route path="/paperwork/progress" component={RequireAuth(PaperWorkProgress)}/>

    0熱度

    1回答

    我使用react-navigation來構建嵌套的TabNavigator。 我的問題是我無法瀏覽到其他選項卡,直到我點擊搜索按鈕。這太奇怪了。 (UPDATE)我剛剛發現,當我更改標籤時,它只會更改「關注」或「熱門」標題。它不呈現seconrd選項卡,「常用」,並且不會切換選項卡。 這裏是第一StackNavigator(附加到根) export default StackNavigator (

    0熱度

    1回答

    我需要訪問外部JavaScript文件中的道具。 我有一個保存靜態值的JavaScript文件。像 export const SEARCH = { [Data.NAME]: 'search-default', [Data.LABEL]: 'Search', [Data.TYPE]: Types.INPUT_SEARCH, [InputData.PLACEHO

    0熱度

    1回答

    我有HOC檢查是登錄用戶。 import React from 'react'; import { Redirect } from 'react-router-dom'; export default function requireAuthComponent(store, Component, redirectTo = '/') { return class RequireAut

    2熱度

    1回答

    我想在我的Nginx服務器的子文件夾中部署一個React應用程序。 此React應用的位置結構如下:www.example.com/reactApp。 我試圖建立我目前nginx.conf像這樣: server { ..other configs.. location /reactApp { root /var/www; index reactApp/

    1熱度

    2回答

    其實很簡單,我正在嘗試做,但我猜不夠簡單。我想在傳遞一個靜態參數時從一個頁面重定向到另一個頁面。 例子: /learn =>/with ?source=ABC123 我嘗試使用下面的代碼來做到這一點: <Route path="/" component={App}> <IndexRoute component={HomePage}/> <Redirect from="/lear

    0熱度

    2回答

    我想呈現一些頂部有nav的路由,同時呈現沒有任何導航的其他路由(如註冊/登錄頁面)。 對於淨資產值的設置,我有: const App =() => ( <Router> <div> <Nav /> <div> <Route exact path="/" component={Home} /> <Route path="/accoun

    1熱度

    2回答

    我正在嘗試爲使用react和redux構建的應用程序實現路由。我已經打包,以便路由處理程序可以訪問該商店。但不知何故,我的路由邏輯不起作用。 這段代碼是工作的罰款 export default class Root extends Component { render() { return ( <Provider store={this.props.sto

    0熱度

    2回答

    我正在開發我的第一個React項目,我對如何解決這種情況感到困惑。 Header組件支持多種不同的主題,我需要根據所顯示的頁面切換。這是我的根組件: export default class App extends React.Component { render() { return ( <Router> <div> <Head