Skip to content

Instantly share code, notes, and snippets.

@jqed-xuereb
Created August 29, 2017 09:41
Show Gist options
  • Save jqed-xuereb/ad5f1facc15ddcdff758c04a07b1dae8 to your computer and use it in GitHub Desktop.
Save jqed-xuereb/ad5f1facc15ddcdff758c04a07b1dae8 to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactNative from 'react-native';
var AccountFields = React.createClass({
render: function() {
return (
<div>
<h2>Account Details</h2>
<ul className="form-fields">
<li>
<label>"What's your first name ?"</label>
<input type="text" ref="firstname" defaultValue={this.props.fieldValues.first} />
</li>
<li>
<label>"What's you last name ?"</label>
<input type="text" ref="lastname" defaultValue={this.props.fieldValues.last} />
</li>
<li className="form-footer">
<button className="btn -primary pull-right" onClick={this.nextStep}>Save &amp; Continue</button>
</li>
</ul>
</div>
)
},
nextStep: function(e) {
e.preventDefault()
// Get values via this.refs
var data = {
first : this.refs.first.getDOMNode().value,
last : this.refs.last.getDOMNode().value,
}
this.props.saveValues(data)
this.props.nextStep()
}
})
module.exports = NameFields
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment