react的報錯 You should not use ‘Link’ outside a ‘Router’
環境:
- “react”: “^16.4.0”,
- “react-dom”: “^16.4.0”,
- “react-redux”: “^5.0.7”,
- “react-router”: “^4.3.1”,
- “react-router-dom”: “^4.3.1”
我在Header元件中 寫了一個Link跳轉路由,一直報錯誤
You should not use <Link> outside a <Router>
產生這個原因是 Header的元件木有寫在BrowserRouter 裡導致
- 解決辦法
class App extends Component { render() { return ( <Provider store={store}> <BrowserRouter> <div> <Header /> <Route path='/' exact component={Home}></Route> <Route path='/detail/:id' exact component={Detail}></Route> <Route path='/login' exact component={Login}></Route> </div> </BrowserRouter> </Provider> ) } }
相關推薦
react的報錯 You should not use ‘Link’ outside a ‘Router’
環境: “react”: “^16.4.0”, “react-dom”: “^16.4.0”, “react-redux”: “^5.0.7”, “react-router”: “^4.3.1”, “react-router-dom”: “^4.3.1
react的報錯 You should not use ‘Link’ outside a ‘Router’
環境: “react”: “^16.4.0”, “react-dom”: “^16.4.0”, “react-redux”: “^5.0.7”, “react-router”: “^4.3.1”, “
git pull 報錯 You have not concluded your merge (MERGE_HEAD exists).
src 報錯 gpo inf 技術分享 pos com bsp not git pull時報錯 解決方案: git pull 報錯 You have not concluded your merge (MERGE_HEAD exists).
ionic打包報錯:You have not accepted the license agreements of the following SDK components: [Android S
錯誤資訊: ...... You have been opted out of telemetry. To change this, run: cordova telemetry on. Android Studio project detected ANDROID_HOME=C:\User
對話方塊報錯 You need to use a Theme.AppCompat theme (or descendant) with this activity.
在跟著視訊學習安卓開發時候發現程式碼一致,結果我的卻報錯。 原因:我是用的開發環境為Androidstudio,視訊中使用的是eclipse。在Androidstudio中activity預設繼承的AppCompatActivity,只需要在Androidmanifest檔案中配
ionic打包報錯:You have not accepted the license agreements of the following SDK components: [Android S
錯誤資訊: ...... You have been opted out of telemetry. To change this, run: cordova telemetry on. Android Studio project detected ANDROID_HO
Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextE
使用Cocoapods 匯入第三方的資源時,出現如下警告: !Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use Text
Akka HTTP部署報錯:Could not resolve substitution to a value: ${akka.stream.blocking-io-dispatcher}
在idea中使用akka http完成服務端rest介面的開發與測試後,接著就可以部署到Linux伺服器上進行測試了,因為沒有限定pom中依賴包的scope為provided,所以打包時將依賴jar包也打進了專案jar包,方便執行測試,但是專案jar包較大,後續再分離依賴的jar包。打包時候po
laravel-admin報錯:Disk [admin] not configured, please add a disk config in `config/filesystems.php`.
在config/filesystems.php中disks新增: 'admin' => [ 'driver' => 'local', 'root'
ES報錯:Can not be imported as a dangling index as index with same name already exists in cluster me
解決方案: 你不應該直接刪除報警日誌中的.kibana index,因為可能會因此在kibana中丟失資料。假如你曾經刪除過 .kibana indice,那麼這個警告就是你過去那個刪除操作的殘留結果。 預設情況:kibana會 使用es的索引去儲存儲存
git clone報錯 "Could not read from remote repository..Please make sure you have the correct access
1.下載git,使用命令: yum install git 2.配置git: 1 git config --global user.name "Your Name" 2 git config --global user.email "[email protected]"
myBatis查詢報錯 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
myBatis查詢報錯 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
react-router-app Redirect 報錯You tried to redirect to the same route you're currently on:xxx
我們寫了一個 react路由重定向 當時根路由時自動重定向到登入 下面的寫法執行是 是可以執行的但是會報出一個錯誤 You tried to redirect to the same route you’re currently on:login <Route pa
react-native報錯SDK location not found
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable 解決:
react報錯Module not found: Error: Can't resolve
學習react專案,想把.js結尾的檔案改為.jsx結尾,結果一直報錯,網上找了好久,總算解決了,在webpack.dev.config.js檔案中新增resolve: { extensions: ['.
React Native報錯unddefined is not an object(evaluating ‘_reactnative.propTypes’)解決辦法
報錯截圖 原程式是這樣寫的,然後一直出現錯誤,找不到PropTypes, import React,{Component } from 'react'; import { View,
react-native---react-native run-android啟動時候報錯"JS server not recognized, continuing with build..."
啟動react-native run-android命令進行除錯時候,可能會遇到服務找不到的報錯: JS server not recognized, continuing with build.. 此時模擬器上是經典的紅色報錯。。。 解決方法
ssh報錯:Could not load host key:/etc/ssh/ssh_host_rsa_key&ssh_host_ecdsa_key&ssh_host_ed25519_key
ssh報錯:could not load host key今天ssh遠程的時候發現無法遠程,登錄主機查看ssh服務狀態,報錯如下去查看秘鑰發現文件大小為0,看起來是生成秘鑰失敗了才導致的故障,解決方法簡單,刪除原有的秘鑰,重新生成秘鑰就OK了然後重啟ssh服務,自動生成新的秘鑰就可以了或者也可以通過命令行重新
解決用戶自生成meta導入kylin後報錯問題Can not deserialize instance of java.lang.String[] out of VALUE_STRING token
pri ner hbase cau ebean 要求 eno pre property 報錯棧: 2017-06-22 20:48:07,101 ERROR [http-bio-7070-exec-5] cube.CubeManager:947 : Error dur
加壓壓縮文件報錯gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
child tdi tex save 重新 屬性 保存 div sta 壓縮包是直接weget 後面加官網上的tar包地址獲取的 [[email protected]/* */ ~]# tar -zxvf /home/hadoop/hadoop-2.6.5-