Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react set multible attribute values

render () {
  const attributes = {
    className: 'form-input form-input--email',
    id: 'user-email',
    type: 'email',
    name: 'user-email',
    placeholder: this.props.placeholder,
    required: this.state.required
  }
  return <div className='form-field'>
    <label className='form-label' htmlFor='user-email'>Email: </label>
    <input {...attributes}>
  </div>	
}
Source by nikitahl.com #
 
PREVIOUS NEXT
Tagged: #react #set #multible #attribute #values
ADD COMMENT
Topic
Name
3+3 =