Closed
Description
Steps to reproduce
$ npx react-native init MyApp --template react-native-template-typescript
...
$ cd MyApp/
$ npx tsc --skipLibCheck
App.tsx:12:15 - error TS2305: Module '"./node_modules/@types/react"' has no exported member 'Node'.
12 import type {Node} from 'react';
~~~~
App.tsx:31:20 - error TS7031: Binding element 'children' implicitly has an 'any' type.
31 const Section = ({children, title}): Node => {
~~~~~~~~
App.tsx:31:30 - error TS7031: Binding element 'title' implicitly has an 'any' type.
31 const Section = ({children, title}): Node => {
~~~~~
Found 3 errors.
Expected results
A newly created project should be valid Typescript (according to the accompanying tsconfig.json
). It would also be nice to be styled e.g. according to some prettier rules.
Observed results
Running the app works (npm run ios
) but compiling the code fails and VScode shows the following errors:
- React does not have a type
Node
Section
component uses implicitany
types (disallowed by strict mode configured intsconfig.json
)
These are both introduced in #193.
Also App.tsx shows up bright red/yellow in VScode with prettier for example because every code line is indented by one space.
It would be great if the code validity could be (automatically) tested prior to releases.
Metadata
Metadata
Assignees
Labels
No labels