title: Split out props.location.search value
body: <p>I'm trying to split out the values from props.location.search in React/Redux. I've successfully obtained the mixOne split however I can't seem to return the value of quantity. Here's my code:</p>
  <pre><code>  const mixOne = props.location.search
      ? String(props.location.search.split(&quot;mixOne=&quot;)[1])
      : &quot;None&quot;;
    const quantity = props.location.search
      ? Number(props.location.search.split(&quot;=&quot;)[1])
      : 1;
  </code></pre>
  <p>And here's the URL that gets generated:</p>
  <pre><code>  const addToCartHandler = () =&gt; {
      props.history.push(
        `/Cart/${productId}?quantity=${quantity}?mixOne=${mixOne}`
      );
    };
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Wfjyf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wfjyf.png" alt="query" /></a></p>
  <p>As you can see quantity returns null, when I need the value selected</p>
  <p><a href="https://i.stack.imgur.com/mjPsk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mjPsk.png" alt="enter image description here" /></a></p>