Last active
October 28, 2015 09:25
-
-
Save aakashns/42ee6a4a481ce2c85943 to your computer and use it in GitHub Desktop.
Common component shared between React and React Native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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