From a97fd80966d376a688ba72ec37f74eff6f888457 Mon Sep 17 00:00:00 2001 From: Marcello Lamonaca Date: Thu, 25 Mar 2021 18:46:56 +0100 Subject: [PATCH] Typo fixes --- JavaScript/React/React Router.md | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/JavaScript/React/React Router.md b/JavaScript/React/React Router.md index 2895428..0ae60a2 100644 --- a/JavaScript/React/React Router.md +++ b/JavaScript/React/React Router.md @@ -46,24 +46,10 @@ import { Route, Switch } from "react-router-dom"; - {/* mathes all non-existent URLs */} + {/* matches all non-existent URLs */} ``` -### Redirectin - -```js -import { Redirect } from "react-router-dom"; - -// redirects to another URL, should'nt be rendered on component mount but after an action - - -{ condition && } // redirect if condition is true - -// or redirect manipolating the history (alwais in props) -props.history.push("/new-route"); -``` - ### URL Parameters & Query String ```js @@ -78,12 +64,26 @@ function Component(props) { } ``` -### Propts +### Redirecting + +```js +import { Redirect } from "react-router-dom"; + +// redirects to another URL, should'nt be rendered on component mount but after an action + + +{ condition && } // redirect if condition is true + +// or redirect manipolating the history (always in props) +props.history.push("/new-route"); +``` + +### Prompts ```js import { Prompt } from "react-router-dom"; -// displayes a prompt when the conditioni true +// displayes a prompt when the condition is true ```