2

Why do I get the parsing error

Parsing error: Unexpected token Props (null)

for this react native app example code? I am using the standardJS linter.

import React, { Component } from 'react';
import {
  Text,
  View
} from 'react-native';

type Props = {}; // <-- What is wrong with that?
export default class App extends Component<Props> {
  render() {
    return (
      <View>
        <Text>
          Welcome to React Native!
        </Text>
      </View>
    );
  }
}
user3142695
  • 15,844
  • 47
  • 176
  • 332

1 Answers1

0

Unless there is a good reason why you want to send the Props, you dont need that. Just remove it and keep 'Component {}'

Also, it could be that you need to use static instead of type. If you are copying this from another place, they are maybe using babel and another module. This is the first time I have seen someone write this.

sebastianf182
  • 9,844
  • 3
  • 34
  • 66