title: How do I combine existing InputProps with additional InputProps in child component
body: <p>I have written a customized version of material-ui TextField (lets call it CustTextField1) with customized styling. I wish to develop another customization called CustTextField2 based on the styling of CustTextField1. I have applied InputProps to CustTextField1 and I want these to be used in CustTextField2 along with some additional InputProps I apply there. Here are the relevant parts of the code. The InputProps applied to CustTextField2 appear(i.e. The password eye icon) but appear to override the InputProps already set in CustTextField1. Any help on how to combine the two would be much appreciated.</p>
  
  <pre><code>function CustTextField1(props) {
    return (
      &lt;TextField
        InputProps={{     
          disableUnderline: true,
          classes: {
            root: textFieldStyle.rootInputStyle,
            focused: textFieldStyle.focused,
            disabled: textFieldStyle.disabled,
            error: textFieldStyle.error
          }
        }}
  
        {...props}
      /&gt;
  )
  }
  </code></pre>
  
  <pre><code>function CustTextField2(props) {
    return (
      &lt;CustTextField1
      InputProps={{    
          endAdornment: (
                      &lt;InputAdornment position="end"&gt;
                          &lt;IconButton&gt;
                              {showPassword ? &lt;Visibility/&gt; : &lt;VisibilityOff/&gt;}
                          &lt;/IconButton&gt;
                      &lt;/InputAdornment&gt;
                  ),
            ...props.InputProps
          }
        }}
  
        {...props}
      /&gt;
  )
  }
  </code></pre>
  
  <p>I would like the InputProps styling in CustTextField1 to be combined with the additional InputProps styling in CustTextField2.</p>
  
  <p>!!UPDATED!!</p>
  
  <p><strong>Code Sandbox (Original Problem)</strong> - <a href="https://codesandbox.io/s/fervent-smoke-g8nsb" rel="nofollow noreferrer">https://codesandbox.io/s/fervent-smoke-g8nsb</a></p>
  
  <p><strong>Code Sandbox (Solution)</strong> with sincere thanks to post from <em>toutpt</em> below - <a href="https://codesandbox.io/s/stoic-mclean-9kh1r" rel="nofollow noreferrer">https://codesandbox.io/s/stoic-mclean-9kh1r</a></p>