Skip to content

Instantly share code, notes, and snippets.

@aakashns
Last active October 28, 2015 09:25
Show Gist options
  • Select an option

  • Save aakashns/42ee6a4a481ce2c85943 to your computer and use it in GitHub Desktop.

Select an option

Save aakashns/42ee6a4a481ce2c85943 to your computer and use it in GitHub Desktop.
Common component shared between React and React Native
export default function (React) {
var Name = React.createClass({
getInitialState: function() { /* No Change */ },
validate: function(value) { /* No Change */ },
syncToServer: function() { /* No Change */ },
onValueChange: function(value) { /* No Change */ },
render: function() {
var { value, errors, sync } = this.state
var RenderView = this.props.view;
return <RenderView value={value}
errors={errors}
sync={sync}
onValueChange={this.onValueChange} />;
}
});
return Name;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment