title: Passing value from a map function to a React component
body: <p>I'm a little unsure how to take the value <code>showBtn</code> and pass it into my &lt;<code>ListComponent /&gt;</code></p>
  <p>Here's the code:</p>
  <pre><code>  const listOptions = list.actionCollection
      .map((option) =&gt; {
        const showBtn = option.has(RENDER_BTN);
  
        // tried to assign showBtn to a value that could be passed to component below
  
        return option;
      });
  </code></pre>
  <pre><code>{listOptions.map((option) =&gt; (
     &lt;ListComponent option={option} key={option.key} /&gt;
  ))}
  
  </code></pre>
  <p>My check for <code>showBtn</code> is working fine (returning true or false) but I can't access <code>showBtn</code> outside of the map function. Obviously the map is checking through various values so some will be true &amp; others false, so keeping the map syntax is important. Any suggestions would be appreciated!</p>