title: Property 'navigation' does not exists on type 'Readonly<{}> & Readonly<{ children?: ReactNode; }>
body: <p>I am completely new to react native.</p>
  
  <p>I have the following components:</p>
  
  <p>Playlists:</p>
  
  <pre><code>export default class Playlists extends Component {
    playlists = [
      ...
    ];
  
    render() {
      const {navigation} = this.props.navigation;
  
      return (
        &lt;FlatList
          data={this.playlists}
          renderItem={({item}) =&gt; (
            &lt;TouchableOpacity
              style={styles.item}
              onPress={() =&gt; navigation.navigate('PlaylistDetails', item)}&gt;
              &lt;Text style={styles.text}&gt;{item.name}&lt;/Text&gt;
            &lt;/TouchableOpacity&gt;
          )}
        /&gt;
      );
    }
  }
  </code></pre>
  
  <p>Details View of a Playlist:</p>
  
  <pre><code>export default class PlaylistDetails extends Component {
    render() {
      const {navigation} = this.props.navigation;
      var songs: Song[] = navigation.getParam('songs');
  
      return (
        &lt;View&gt;
          &lt;Text&gt;{navigation.getParam('name')}&lt;/Text&gt;
          &lt;FlatList
            data={songs}
            renderItem={({item: song}) =&gt; &lt;Text&gt;{song.title}&lt;/Text&gt;}
          /&gt;
        &lt;/View&gt;
      );
    }
  }
  </code></pre>
  
  <p>And for navigation:</p>
  
  <pre><code>const screens = {
    Playlists: {
      screen: Playlists,
    },
    PlaylistDetails: {
      screen: PlaylistDetails,
    },
  };
  
  const stack = createStackNavigator(screens);
  
  export default createAppContainer(stack);
  </code></pre>
  
  <p>But at <code>const { navigation } = this.props.navigation;</code> I get an error <code>Property 'navigation' does not exist on type ...</code>.</p>
  
  <p>I have tried adding the following code:</p>
  
  <pre><code>interface Props {
      navigation: any
  }
  </code></pre>
  
  <p>and then adding this:</p>
  
  <pre><code>export default class PlaylistDetails extends Component&lt;Props&gt; {
      ...
  }
  </code></pre>
  
  <p>This removes the errors, but when I run the application, I get the following error: <code>TypeError: undefined is not an object (evaluating 'navigation.navigate')</code>.</p>
  
  <p>I am totally new to react native and don't know how to solve that. I hope somebody can help me.</p>