Commit 2d2d2d4a by Wee

docs: add warning for react-router 4.4

parent fa187af3
...@@ -65,6 +65,10 @@ There is a item list page, click on the items on this page will enter the item d ...@@ -65,6 +65,10 @@ There is a item list page, click on the items on this page will enter the item d
- 🔒 Minimally invasive, all you need to do is import LiveRoute. - 🔒 Minimally invasive, all you need to do is import LiveRoute.
- ✌️ Super easy API. - ✌️ Super easy API.
## Must read ⚠️
react-live-route is not compatible with `react-router-dom` 4.0+ due to the **`this.context.router`** become it's private API(see [here](https://github.com/ReactTraining/react-router/releases/tag/v4.4.0-beta.0)). This could not be resolved by current design of `react-live-route` unfortunately. By the way, I really do not like `this.context.router` became a private API afterwards ☹️.
## Caveat ⚠️ ## Caveat ⚠️
- LiveRoute **SHOULD NOT** be wrapped by `Switch` directly, cause `Switch` only render the first matched child element so that LiveRoute may be skipped directly. You can move LiveRoute from `Switch` to the outside. - LiveRoute **SHOULD NOT** be wrapped by `Switch` directly, cause `Switch` only render the first matched child element so that LiveRoute may be skipped directly. You can move LiveRoute from `Switch` to the outside.
......
{ {
"name": "react-live-route", "name": "react-live-route",
"version": "2.0.0", "version": "2.0.7",
"description": "A living route for react-router v4", "description": "A living route for react-router v4",
"repository": "fi3ework/react-live-route", "repository": "fi3ework/react-live-route",
"license": "MIT", "license": "MIT",
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
"react": ">=15", "react": ">=15",
"react-router-dom": ">=4 < 4.4" "react-router-dom": ">=4 < 4.4"
}, },
"files": [
"dist/"
],
"dependencies": { "dependencies": {
"history": "^4.9.0", "history": "^4.9.0",
"invariant": "^2.2.4", "invariant": "^2.2.4",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment