title: Why is React saying “Invalid prop `children`” types is object not function?
body: <p>I have problem with prop-types. Warning message appear which said that <code>children</code> is object not a function. </p>
  
  <p>But when I change that in object I have problem with npm Lint. </p>
  
  <p>Which says that cannot be type of object.</p>
  
  <p>How to avoid this issue?</p>
  
  <p>Component code:</p>
  
  <pre><code>import propTypes from 'prop-types';
  import * as React from 'react';
  
  export default function layout({ children, title }) {
    return (
      &lt;div className="root"&gt;
  
        &lt;h2&gt;{title}&lt;/h2&gt;
  
        {children}
  
      &lt;/div&gt;
    );
  }
  
  layout.propTypes = {
    children: propTypes.func.isRequired,
    title: propTypes.string.isRequired
  };
  </code></pre>
  
  <p><strong>Warrning</strong> message:</p>
  
  <blockquote>
    <p>Warning: Failed prop type: Invalid prop <code>children</code> of type <code>object</code> supplied to <code>layout</code>, expected <code>function</code>.
        in layout
        in Index
        in Container
        in App
        in Context.Provider
        in Context.Provider
        in Context.Provider
        in Context.Provider</p>
  </blockquote>