title: React - Display all properties of an object
body: <p>I'm sure, this is a simple question, but actually I cannot find where my mistake is.
  I have a component where an object has not a fixed number of properties. 
  Actually I'm having trouble to display all properties of the object.</p>
  
  <pre><code>import React, { Component } from 'react';
  
  class FreightRelayWithPricesAndAreas extends Component {
  
      constructor(props) {
          super(props);
          this.state = {
            freightRelayPrice: props.freightRelayPrice
          };
      }
  
      render() {
        const Fragment = React.Fragment;
        return (
          &lt;Fragment&gt;
            &lt;tr&gt;
              {
                Object.keys(this.state.freightRelayPrice).map(function(key) {
                    return &lt;td className="whiteSpaceNoWrap"&gt;{ this.state.freightRelayPrice[key] }&lt;/td&gt;
                })
              }
            &lt;/tr&gt;
          &lt;/Fragment&gt;
        )
      }
  }
  
  export default FreightRelayWithPricesAndAreas
  </code></pre>
  
  <p>The error is always:</p>
  
  <blockquote>
    <p>app.js:57763 Uncaught TypeError: Cannot read property 'state' of
    undefined</p>
    
    <p>at app.js:57763</p>
    
    <p>at Array.map ()</p>
    
    <p>at FreightRelayWithPricesAndAreas.render (app.js:57759)</p>
    
    <p>at finishClassComponent (app.js:48488)</p>
    
    <p>at updateClassComponent (app.js:48465)</p>
    
    <p>at beginWork (app.js:48840)</p>
    
    <p>at performUnitOfWork (app.js:50839)</p>
    
    <p>at workLoop (app.js:50903)</p>
    
    <p>at HTMLUnknownElement.callCallback (app.js:41157)</p>
    
    <p>at Object.invokeGuardedCallbackDev (app.js:41196)</p>
  </blockquote>
  
  <p>As I already said, I'm sure this is simple, but actually I don't see the reason why this happens. Thanks for your help in advance!</p>