Skip to content

Instantly share code, notes, and snippets.

@martinyung
Last active June 25, 2017 08:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martinyung/794dcdaf75ecc3c015b1ae4605d5f72f to your computer and use it in GitHub Desktop.
Save martinyung/794dcdaf75ecc3c015b1ae4605d5f72f to your computer and use it in GitHub Desktop.
conversational-form with react.js - render()
class Hello extends Component {
...
render() {
return (
<div>
<h2>Conversational Form</h2>
<div id="cf-context" > {/* <-- the cf form will be bound to this element */}
<form id="form" className="form" ref="form">
<input type="text" ref="name" placeholder="Name" defaultValue={this.props.name}/>
<input type="email" ref="email" placeholder="Email" defaultValue={this.props.email}/>
<select ref="description" type="radio" id="links"> {/* <-- using selection for options */}
<option value="request_1">Request 1</option>
<option value="request_2">Request 2</option>
</select>
</form>
</div>
</div>
);
}
}
export default Hello;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment