I'm the newbie of the react-native and study with the complete code. But I can't understand the diffrence between "const" before export and after render. for example:

```
const { height, width } = Dimensions.get("window");

export default class App extends React.Component {
  state = {
    newToDo: ""
  };
  render() {
    const { newToDo } = this.state;

```

why I ask this is because my first init is not "export default class App extends React.Component {" but "export default function App() {". So I can't assign const or assign it and it cause the Error showing the message 

> 
> TypeError:undefined is not an object (evaluating 'this.state')
> 
> 
> 

this is my code :

```
import React from "react";
import {
  StyleSheet,
  Text,
  View,
  Dimensions,
  TextInput,
  Platform,
  ScrollView
} from "react-native";
import ToDo from "./ToDo";

const { height, width } = Dimensions.get("window");
export default function App() {
  const state = {
    newToDo: ""
  };
  const { newToDO } = this.state;
  return (
    <View style={styles.container}>
      <View style={styles.titleContainer}>
        <Text style={styles.title}>Good or Bad</Text>
        <Text style={styles.subTitle}>Check Daily your habit</Text>
      </View>

      <View style={styles.content}>
        <Text style={styles.contentTitle}>To Do List</Text>
        <TextInput
          style={styles.input}
          placeholder={"New to do"}
          value={newToDO}
          onChangeText={this._controllNewToDo}
          returnKeyType={"done"}
          autoCorrect={false}
        />
        <ScrollView>
          <ToDo />
        </ScrollView>
      </View>
    </View>
  );

  _controllNewToDo = text => {
    this.setState({
      newToDO: text
    });
  };
}

```