mirror of
https://github.com/m-lamonaca/dev-notes.git
synced 2025-06-09 03:07:13 +00:00
remove mkdocs specific syntax
This commit is contained in:
parent
8d08c1964f
commit
8026e1465b
77 changed files with 1128 additions and 1128 deletions
|
@ -16,7 +16,7 @@ Router Types:
|
|||
- *BrowserRouter*: `/route`, uses HTML5 history API to provide clean URLs
|
||||
- *MemoryRouter*: no URL
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
// index.js
|
||||
|
||||
//other imports ...
|
||||
|
@ -31,7 +31,7 @@ React.render(
|
|||
)
|
||||
```
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
// Component.js
|
||||
import { Route, Route } from "react-router-dom";
|
||||
|
||||
|
@ -52,7 +52,7 @@ import { Route, Route } from "react-router-dom";
|
|||
|
||||
### URL Parameters & Query String
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
// Given
|
||||
<Route path="/route/:placeholder" element={<Component props={props} />} />
|
||||
// URL: app.com/route/sub-route?param=value
|
||||
|
@ -66,7 +66,7 @@ function Component(props) {
|
|||
|
||||
### Redirecting
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
import { Navigate } from "react-router-dom";
|
||||
|
||||
// redirects to another URL on render, shouldn't be rendered on component mount but after an action
|
||||
|
@ -80,7 +80,7 @@ props.history.push("/new-route");
|
|||
|
||||
### Prompts
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
import { Prompt } from "react-router-dom";
|
||||
|
||||
// displays a prompt when the condition is true
|
||||
|
@ -91,7 +91,7 @@ import { Prompt } from "react-router-dom";
|
|||
|
||||
Clicks on a link created with React-Router will be captured by react an all the routing will happen client side.
|
||||
|
||||
```js linenums="1"
|
||||
```js
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
// TARGET: <Route path="/route/:itemId" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue