Skip to content
This repository has been archived by the owner on Sep 13, 2020. It is now read-only.

undefined is not a function (near '..._react2.default.createClass...') Why am i getting this error ? #367

Open
ZunairaMarwat opened this issue Oct 23, 2018 · 0 comments

Comments

@ZunairaMarwat
Copy link

import React , {Component} from 'react';
import { AppRegistry,Text, View, StyleSheet, Alert } from 'react-native';
import RadioForm, {RadioButton, RadioButtonInput, RadioButtonLabel} from 'react-native-simple-radio-button';

var radio_props = [
{label: 'param1', value: 0 },
{label: 'param2', value: 1 }
];

var App = React.createClass({
getInitialState: function() {
return {
value: 0,
}
},

select_function: function(value){
console.log(value);
if (value == 0) {
Alert.alert(
'Your text',
"Select param1"
);
}

if (value == 1){
Alert.alert(
'Your Text',
"Select param2"
);
}
},
render: function() {
return (

<RadioForm
radio_props={radio_props}
initial={0}
onPress={(value) => {this.setState({value:value}); this.select_function(value)}}
/>

);
}
});

AppRegistry.registerComponent('App' , () => App);

@ZunairaMarwat ZunairaMarwat changed the title undefined is not a function (near '..._react2.default.createClass...') undefined is not a function (near '..._react2.default.createClass...') Why am i getting this error ? Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant