title: Reactjs, How to compare props.location.pathname to a string?
body: <p>In my router, I need to do the following:</p>
  
  <pre><code>if (props.location.pathname !== '/confirm') {
      // redirect to /confirm to force the user to confirm their email
  }
  </code></pre>
  
  <p>The if statement is not acting as expected.</p>
  
  <p>If I output:  </p>
  
  <pre><code>console.log(props.location.pathname)
  </code></pre>
  
  <p>I get in the console.</p>
  
  <pre><code>/confirm
  </code></pre>
  
  <p>However, <code>props.location.pathname</code> with the value of '/confirm' is not being seen as the same as <code>/confirm</code></p>
  
  <p>What am I doing wrong?</p>