title: Filtering based on state items
body: <p>So i have this array as my state:</p>
  <pre><code>[&quot;item-one&quot;,&quot;item-two&quot;, &quot;item-three&quot;]
  </code></pre>
  <p>Now i have these items on my webpage:</p>
  <pre><code>Item One
  Item Two
  Item Three
  Item Four
  Item Five
  </code></pre>
  <p>How can i filter these items based on the state of my array. So when i filter i would get the three first items? The html of the items are like so.</p>
  <pre><code>    &lt;div&gt;
        &lt;label htmlFor=&quot;item-one&quot;&gt;Item One&lt;/label&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;&quot; id=&quot;item-one&quot;/&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;label htmlFor=&quot;item-two&quot;&gt;Item Two&lt;/label&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;&quot; id=&quot;item-two&quot;/&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;label htmlFor=&quot;item-three&quot;&gt;Item Three&lt;/label&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;&quot; id=&quot;item-three&quot;/&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;label htmlFor=&quot;item-four&quot;&gt;Item Four&lt;/label&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;&quot; id=&quot;item-four&quot;/&gt;
      &lt;/div&gt;
      &lt;div&gt;
        &lt;label htmlFor=&quot;item-five&quot;&gt;Item Five&lt;/label&gt;
        &lt;input type=&quot;checkbox&quot; name=&quot;&quot; id=&quot;item-five&quot;/&gt;
      &lt;/div&gt;
  </code></pre>
  <p>should i use a map function or what is the best approach?</p>