title: Access Redux State Object Property in Function
body: <p>I have an inline function in my react component set up like this: </p>
  
  <pre><code>render() {
      const { post } = this.props;
  
      return (
          &lt;div&gt;
              {function(){
                  if ({post}) {
                      return &lt;h1&gt;Post name exists {post.name}&lt;/h1&gt;
                  } else {
                      return &lt;h1&gt; Post name does not exist&lt;/h1&gt;
                  }
              }.call(this)}
       .....
  </code></pre>
  
  <p>and I have redux state set up like this:</p>
  
  <pre><code>function mapStateToProps(state) {
      return { 
          post:state.post.single,
      };
  }
  </code></pre>
  
  <p>The above code works, but what I really want to check is if post.name is null or not, in which case I render different things on the page. However, I keep getting an error when I do this:</p>
  
  <pre><code>if({post.name})
  </code></pre>