title: React functional component default props vs default parameters
body: <p>In a React <em>functional component</em>, which is the better approach to set default props, using <code>Component.defaultProps</code>, or using the <em>default parameters</em> on the function definition, examples:</p>
  
  <p>Default props:</p>
  
  <pre><code>const Component = ({ prop1, prop2 }) =&gt; (
    &lt;div&gt;&lt;/div&gt;
  )
  
  Component.defaultProps = {
    prop1: false,
    prop2: 'My Prop',
  }
  </code></pre>
  
  <p>Default parameters:</p>
  
  <pre><code>const Component = ({ prop1 = false, prop2 = 'My Prop' }) =&gt; (
    &lt;div&gt;&lt;/div&gt;
  )    
  </code></pre>