title: Switch of react router dom doesn't work if I put in another component
body: <p>I'm learning react and I try to switch between my pages with react-router-dom.</p>
  <p>I have a component Menu with my links and I call this component into my App component but it doesn't work. But if a put my links directly into my App component it works well.</p>
  <p>And also, it doesn't work if I leave <code>to=&quot;/&quot;</code> but i put somethig else like <code>to=&quot;/home&quot;</code> for the first link.</p>
  <pre><code>const Menu = () =&gt; {
    const padding = {
      paddingRight: 5
    }
    return (
      &lt;Router&gt;
          &lt;Link style={padding} to=&quot;/&quot;&gt;anecdotes&lt;/Link&gt;
          &lt;Link style={padding} to=&quot;/create&quot;&gt;create new&lt;/Link&gt;
          &lt;Link style={padding} to=&quot;/about&quot;&gt;about&lt;/Link&gt;
      &lt;/Router&gt;
    )
  }
  </code></pre>
  <p>And a component App.js that return my routes</p>
  <pre><code>  return (
      &lt;div&gt;
        &lt;h1&gt;Software anecdotes&lt;/h1&gt;
        &lt;Menu /&gt;
        &lt;Router&gt;
          &lt;Switch&gt;
            &lt;Route path=&quot;/s&quot;&gt;
                &lt;AnecdoteList anecdotes={anecdotes} /&gt;
            &lt;/Route&gt;
            &lt;Route path=&quot;/create&quot;&gt;
                &lt;CreateNew addNew={addNew} /&gt;
            &lt;/Route&gt;
            &lt;Route path=&quot;/about&quot;&gt;
                &lt;About /&gt;
            &lt;/Route&gt;
          &lt;/Switch&gt;
        &lt;/Router&gt;
        &lt;Footer /&gt;
      &lt;/div&gt;
    )
  </code></pre>