title: How to use useLocation hook of React Router DOM v6?
body: <pre><code>&lt;div
    className={`alert alert-${showAlert?.color} alert-fixed fade ${
      showAlert ? &quot;show&quot; : &quot;d-none&quot;
    }`}
    role=&quot;alert&quot;
    style={{
      width: &quot;450px&quot;,
      right: &quot;1%&quot;,
      top: &quot;15%&quot;,
      bottom: &quot;unset&quot;,
      left: &quot;unset&quot;,
      transform: &quot;unset&quot;,
    }}
  &gt;
    &lt;div className=&quot;d-flex justify-content-between&quot;&gt;
      &lt;strong&gt;{showAlert?.msg}!&lt;/strong&gt;
      &lt;button
        type=&quot;button&quot;
        className=&quot;btn-close&quot;
        onClick={() =&gt; setShowAlert(false)}
      &gt;&lt;/button&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>