I'm coding my first test app with react-native but I cant get my syntax to work. I dont get this, where Am I doing wrong?
Code:
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
class Form extends React.Component ({
getInitialState: function(){
return {
userEvent : ""
}
},
handleChange: function(e){
this.setState({
userEvent = e.target.value
})
},
render() {
return (
<div>
<h2>{this.userEvent}</h2>
<input type="text" value={this.state.userEvent} onChange={this.handleChange}/>
</div>
)
}
}
Here is where code states it is expecting ",":
export default class App extends Component {
Any tips?
render() {
return (
<Form />
);
}
}
export default class App extends Componentwhy are you just usingextends Componentinstead ofReact.Componentas you are just importingReact