title: React js map fetched data: escape nested array of objects from postgresql (parse not working)
body: <p>I'm using React js, node, express and Postgresql to create and authorize users to access data.</p>
  <p>My problem is that I can't figure out how to map project.value and project.label</p>
  <p>I'm pretty new to this and going crazy over this problem!</p>
  <hr />
  <p>Im using React Select to map fetched project data:</p>
  <pre><code>                &lt;Select
                    isMulti
                    value={this.state.value}
                    options={options.map((bla) =&gt; {
                      return {
                          value: bla.key,
                          label: bla.name
                      };}
                  )}
                    onChange={this.onChangeProject}
                    
                  /&gt;
  </code></pre>
  <hr />
  <p>...And using OnChange like this and then sends it to a postgreql database:</p>
  <pre><code>  onChangeProject(e) {
  
      let value = Array.from(e, option =&gt; ({ value: option.value, label: option.label }));
      
      this.setState({ project: value });
  
    }
  </code></pre>
  <hr />
  <p>when I fetch the data back to display one users datat, json looks like this:</p>
  <pre><code>[
      {&quot;id&quot;:123,
      &quot;username&quot;:&quot;userX&quot;,
      &quot;email&quot;:&quot;abc@abc.com&quot;,
      &quot;password&quot;:&quot;xxxxxxxxxxxxxxx&quot;,
      &quot;project&quot;:&quot;[{\&quot;value\&quot;:\&quot;FIR\&quot;,\&quot;label\&quot;:\&quot;FirstProject\&quot;}, {\&quot;value\&quot;:\&quot;SEC\&quot;,\&quot;label\&quot;:\&quot;SecondProject\&quot;},{\&quot;value\&quot;:\&quot;TP\&quot;,\&quot;label\&quot;:\&quot;Third Project \&quot;}]&quot;,
      &quot;isMod&quot;:&quot;user&quot;,
      &quot;createdAt&quot;:&quot;2022-01-27T14:53:19.815Z&quot;,
      &quot;updatedAt&quot;:&quot;2022-01-27T14:53:19.815Z&quot;}
      ]
  </code></pre>
  <hr />
  <p>I need to be able to map the data to get the project.value and project.label values.</p>
  <p>Some of the things I've tried:</p>
  <ul>
  <li>to map the data two levels</li>
  <li>parse the data before I send it to the</li>
  <li>database parse the data before I map the data</li>
  </ul>