{"action":"closed","issue":{"url":"https://api.github.com/repos/gcanti/tcomb-form-native/issues/263","repository_url":"https://api.github.com/repos/gcanti/tcomb-form-native","labels_url":"https://api.github.com/repos/gcanti/tcomb-form-native/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/gcanti/tcomb-form-native/issues/263/comments","events_url":"https://api.github.com/repos/gcanti/tcomb-form-native/issues/263/events","html_url":"https://github.com/gcanti/tcomb-form-native/issues/263","id":185525086,"number":263,"title":"Cannot read property 'form' of undefined","user":{"login":"Rolando-Barbella","id":6339809,"avatar_url":"https://avatars.githubusercontent.com/u/6339809?v=3","gravatar_id":"","url":"https://api.github.com/users/Rolando-Barbella","html_url":"https://github.com/Rolando-Barbella","followers_url":"https://api.github.com/users/Rolando-Barbella/followers","following_url":"https://api.github.com/users/Rolando-Barbella/following{/other_user}","gists_url":"https://api.github.com/users/Rolando-Barbella/gists{/gist_id}","starred_url":"https://api.github.com/users/Rolando-Barbella/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rolando-Barbella/subscriptions","organizations_url":"https://api.github.com/users/Rolando-Barbella/orgs","repos_url":"https://api.github.com/users/Rolando-Barbella/repos","events_url":"https://api.github.com/users/Rolando-Barbella/events{/privacy}","received_events_url":"https://api.github.com/users/Rolando-Barbella/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T22:16:11Z","updated_at":"2016-10-27T04:14:22Z","closed_at":"2016-10-27T04:14:22Z","body":"### Version\r\n\r\nTell us which versions you are using:\r\n\r\n- \"tcomb-form-native\": \"^0.6.1\"\r\n\r\n- \"react-native\": \"0.36.0\",\r\n\r\n### Expected behaviour\r\n\r\nNot to break, I'm using pretty much the same code from the readme\r\n\r\n### Actual behaviour\r\n\r\nWhen I trigger the onPress (onPress={this.onPress}) method it's breaks saying:\r\n\r\n> Cannot read property 'form' of undefined\r\n\r\n### Full code\r\n```javascript\r\nimport React, { Component } from 'react';\r\nimport t from 'tcomb-form-native';\r\nimport {\r\n  AppRegistry,\r\n  StyleSheet,\r\n  Text,\r\n  View,\r\n  TouchableHighlight\r\n} from 'react-native';\r\n\r\nvar Form = t.form.Form;\r\n\r\n// here we are: define your domain model\r\nvar Person = t.struct({\r\n  name: t.String,              // a required string\r\n  surname: t.maybe(t.String),  // an optional string\r\n  age: t.Number,               // a required number\r\n  rememberMe: t.Boolean        // a boolean\r\n});\r\n\r\nvar options = {}; // optional rendering options (see documentation)\r\n\r\n\r\nexport default class myProject extends Component {\r\n  onPress() {\r\n    // call getValue() to get the values of the form\r\n    var value = this.refs.form.getValue();\r\n    if (value) { // if validation fails, value will be null\r\n      console.log(value); // value here is an instance of Person\r\n    }\r\n  }\r\n  render() {\r\n    return (\r\n      <View style={styles.container}>\r\n        <Text style={styles.welcome}>\r\n          Welcome to React Native!\r\n        </Text>\r\n        <View style={styles.container}>\r\n        {/* display */}\r\n        <Form\r\n          ref=\"form\"\r\n          type={Person}\r\n          options={options}\r\n        />\r\n        <TouchableHighlight style={styles.button} onPress={this.onPress} underlayColor='#99d9f4'>\r\n          <Text style={styles.buttonText}>Save</Text>\r\n        </TouchableHighlight>\r\n      </View>\r\n      </View>\r\n    );\r\n  }\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n  container: {\r\n    flex: 1,\r\n    justifyContent: 'center',\r\n    alignItems: 'center',\r\n    backgroundColor: '#F5FCFF',\r\n  },\r\n  welcome: {\r\n    fontSize: 20,\r\n    textAlign: 'center',\r\n    margin: 10,\r\n  },\r\n  instructions: {\r\n    textAlign: 'center',\r\n    color: '#333333',\r\n    marginBottom: 5,\r\n  },\r\n  title: {\r\n    fontSize: 30,\r\n    alignSelf: 'center',\r\n    marginBottom: 30\r\n  },\r\n  buttonText: {\r\n    fontSize: 18,\r\n    color: 'white',\r\n    alignSelf: 'center'\r\n  },\r\n  button: {\r\n    height: 36,\r\n    backgroundColor: '#48BBEC',\r\n    borderColor: '#48BBEC',\r\n    borderWidth: 1,\r\n    borderRadius: 8,\r\n    marginBottom: 10,\r\n    alignSelf: 'stretch',\r\n    justifyContent: 'center'\r\n  }\r\n});\r\n\r\nAppRegistry.registerComponent('myProject', () => myProject);\r\n\r\n```"}}
{"actor":{"display_login":"gcanti"}}