title: react-router-sitemap doesn't generate urls for dynamic content from list
body: <p>We are using <a href="https://www.npmjs.com/package/react-router-sitemap" rel="nofollow noreferrer">react-router-sitemap</a> for creating sitemap dynamically. We got stuck with adding routes dynamically from our blog. Code returns output correctly, but doesn't add article links to the sitemap, here is the code:</p>
  
  <pre><code>import React, { useEffect } from 'react';
  import {Switch, Route} from 'react-router-dom';
  import HomePage from './homePage/HomePage';
  import Projects from './projects/Projects';
  import Project from './projects/MobileProject/project/Project';
  import Contact from './contact/Contact';
  import Job from './job/Job';
  import Blog from './blog/Blog';
  
  
  const fetch = require("node-fetch");
  const API = "http://wp.mysite.in.ua";
  
  function generatePostsRoutes() {
      console.log("generating posts ...");
      let posts = [];
  
      fetch(API + "/wp-json/wp/v2/posts")
          .then((response) =&gt; response.json())
              .then(content =&gt; {
                  posts = content;
                  console.log(posts.map((value) =&gt; &lt;Route exact path={"/blog/article/" + value.slug} component={Blog} /&gt;));
  
                  if(posts.length !== 0) {
                      return (
                          posts.map((value) =&gt; &lt;Route exact path={"/blog/article/" + value.slug} component={Blog} /&gt;)
                      );
                  }
              });
  }
  
  export default (
      &lt;Switch&gt;
          &lt;Route exact path="/" component={HomePage}/&gt;
          &lt;Route exact path="/projects" component={Projects}/&gt;
          &lt;Route exact path="/project" component={Project}/&gt;
          &lt;Route exact path="/blog" component={Blog}/&gt;
          &lt;Route exact path="/blog/:sortId" component={Blog}/&gt;
          {
              generatePostsRoutes()
          }
          &lt;Route exact path="/job" component={Job}/&gt;
          &lt;Route exact path="/contact" component={Contact}/&gt;
      &lt;/Switch&gt;
  );
  </code></pre>
  
  <p>Here is our sitemap we wanna add blog links after <code>&lt;url&gt; &lt;loc&gt;http://mysite.in.ua/blog/:sortId&lt;/loc&gt; &lt;/url&gt;</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" 
  xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" 
  xmlns:xhtml="http://www.w3.org/1999/xhtml" 
  xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" 
  xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" 
  xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/projects&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/project&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/blog&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/blog/:sortId&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/job&lt;/loc&gt; &lt;/url&gt;
  &lt;url&gt; &lt;loc&gt;http://mysite.in.ua/contact&lt;/loc&gt; &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  
  <p>Thank you for your time, I would be so glad if you can help us)</p>