I am doing a react app in which four components share some same line so how can i wrap those lines and use in all components:
class PersonalInformation extends Component{
render(){
return(
<div className="form-place">
<h3>Personal Information</h3>
<Form onSubmit={this.props.handleSubmit} ref="form">
<fieldset disabled={this.props.disabled}>
<Input type="text" name="firstName" title="FirstName" value=""/>
<Input type="text" name="lastName" title="LastName" value=""/>
<Input type="text" name="fatherName" title="Fathers's Name" value=""/>
<Input type="text" name="motherName" title="Mother's Name" value=""/>
</fieldset>
<button>{this.props.buttonName}</button>
</Form>
</div>
)
}
}
Here the lines below are common in all components so how i can i reuse these lines in all components:
<Form onSubmit={this.props.handleSubmit} ref="form">
<fieldset disabled={this.props.disabled}>
</fieldset>
<button>{this.props.buttonName}</button>
</Form>