This is example in react.js:
Form.jsx
<FormInput
type='text'
name='displayName'
value={displayName}
onChange={this.handleChange}
required
/>
Input.jsx
const FormInput = ({ handleChange, ...otherProps }) => (
<input className="form-input" onChange={handleChange} {...otherProps} />
)
My question is, how can I pass attributes to other components with spread objects? like react.js