- Sep 2023
-
reactrouter.com reactrouter.com
-
You'll only need the trailing * when there is another <Routes> somewhere in that route's descendant tree. In that case, the descendant <Routes> will match on the portion of the pathname that remains (see the previous example for what this looks like in practice).
Something to do with routes in index.js and routes in app.js
-
- Apr 2023
-
vite-remix-router.vercel.app vite-remix-router.vercel.app
Tags
Annotators
URL
-
- Mar 2023
-
www.youtube.com www.youtube.com
-
-
www.infoxicator.com www.infoxicator.com
-
-
reactrouter.com reactrouter.com
-
www.infoxicator.com www.infoxicator.com
-
www.infoxicator.com www.infoxicator.com
-
```js
export const loader = async () => {
// fire them all at once<br /> const critical1Promise = fetch('/test?text=critical1&delay=250').then(res => res.json()); const critical2Promise = fetch('/test?text=critical2&delay=500').then(res => res.json()); const lazyResolvedPromise = fetch('/test?text=lazyResolved&delay=100').then(res => res.json()); const lazy1Promise = fetch('/test?text=lazy1&delay=500').then(res => res.json()); const lazy2Promise = fetch('/test?text=lazy2&delay=1500').then(res => res.json()); const lazy3Promise = fetch('/test?text=lazy3&delay=2500').then(res => res.json()); const lazyErrorPromise = fetch('/test?text=lazy3&delay=3000').then(res => { throw Error('Oh noo!') });
// await for the response return defer({ critical1: await critical1Promise, critical2: await critical2Promise, lazyResolved: lazyResolvedPromise, lazy1: lazy1Promise, lazy2: lazy2Promise, lazy3: lazy3Promise, lazyError: lazyErrorPromise }) } ```
-
- Jan 2023
- Nov 2022
-
remix.run remix.run
Tags
Annotators
URL
-
- Oct 2022
-
reactrouter.com reactrouter.com
-
twitter.com twitter.com
- Sep 2022
-
blog.jim-nielsen.com blog.jim-nielsen.com
-
tkdodo.eu tkdodo.eu
-
remix.run remix.run
Tags
Annotators
URL
-
-
reactrouter.com reactrouter.com
Tags
Annotators
URL
-
-
reactrouter.com reactrouter.com
Tags
Annotators
URL
-
- Jun 2022
-
techlia.hashnode.dev techlia.hashnode.dev
-
Tags
Annotators
URL
-
- May 2022
-
codesandbox.io codesandbox.io
-
- Jan 2022
-
stackblitz.com stackblitz.com
- Dec 2021
- Nov 2021
-
remix.run remix.run
Tags
Annotators
URL
-
- Oct 2018
-
reacttraining.com reacttraining.com
Tags
Annotators
URL
-
- May 2017
-
www.hackingwithreact.com www.hackingwithreact.com
-
<Route path="/" component={ List } /> <Route path="/react" component={ Detail } />
Note, in newer versions of the router, this won't work because a route can only contain one child. Try wrapping the two routes in a <switch>:</switch>
<Switch> <Route exact path="/" component={ List } /> <Route path="/react" component={Detail} /> </Switch>
-
-
www.hackingwithreact.com www.hackingwithreact.com
-
<Router> <Route path="/" component={ Detail } /> </Router>,
In newer versions of React, this won't work without a history prop and hashHistory. Depending on how you import hashHistory, the code will look something like this:
let hashHistory = createHashHistory(); <Router history={hashHistory}> <Route path="/" component={ Detail } /> </Router>,
-