There's no possible to generate all links based on the routes
See original GitHub issueThere’s no possible to generate all links based on the routes, because I had to created a new route-list without import any component. (just links)
Envs:
- npm: 6.5.0
- node: 8.11.2
- react-router-sitemap: 1.2.0
import React from 'react';
import { Route, Redirect } from 'react-router';
export default (
<Route>
<Route path="/" />
<Route path="/about" />
<Route path="/contact" />
<Route path="/company/:id" />
<Route path="/know-more" />
<Route path="/cities">
<Route path='/:slug'>
<Route path='/event/:eventSlug' />
<Route path='/ads' />
</Route>
</Route>
</Route>
);
@kuflash What I could do to solve the param problem? Using database to list those urls?
<url> <loc>https://my-page.net/</loc> </url>
<url> <loc>https://my-page.net/about</loc> </url>
<url> <loc>https://my-page.net/contact</loc> </url>
<url> <loc>https://my-page.net/company/:id</loc> </url>
<url> <loc>https://my-page.net/know-more/business</loc> </url>
<url> <loc>https://my-page.net/city-promotion</loc> </url>
<url> <loc>https://my-page.net/city-promotion/:slug</loc> </url>
<url> <loc>https://my-page.net/city-promotion/:slug/event/:eventSlug</loc> </url>
<url> <loc>https://my-page.net/city-promotion/:slug/ad-sample</loc> </url>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
web crawler - Get a list of URLs from a site - Stack Overflow
Create a mapping between the well known old URLs and the new ones. Redirect when you see an old URL. · If you...
Read more >How To Handle Routing in React Apps with React Router
Step 2 — Adding Routes. In this step, you'll create a base router with individual routes for each page. You'll order your routes...
Read more >URLs and Routing - Meteor Guide
How to drive your Meteor app's UI using URLs with FlowRouter.
Read more >Configuring links | React Navigation
In this guide, we will configure React Navigation to handle external links. This is necessary if you want to:
Read more >Understanding Links in React.js - Pluralsight
In regular apps without a library like React, links are created with an ... components that need re-rendering based on a specified route....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@francisrod01 yes, if you use dynamic routes you need load data for this routes. You can load it’s from DB and create rules for mapping data to dynamic routes. Example creating this params stored in example file.
Some pseudocode:
Also, you can read docs.
@kuflash I mentioned I’ll create that. I think this is the best solution to do that so I’ll close for now.