Skip to content

Conversation

@WoLewicki
Copy link
Member

@WoLewicki WoLewicki commented Jan 28, 2021

Description

PR migrating index files from the library library to TS 🎉

Changes

Changed index.native, index files to TS.
Removed index.d.ts.
Added types.tsx.
Changed package.jsons to properly match new structure of files in lib folder.
Changed tsconfig.json in root to include only files from src and added tsconfig.json for TestsExample project.

Checklist

  • Updated TS types
  • Ensured that CI passes

@WoLewicki WoLewicki mentioned this pull request Jan 28, 2021
3 tasks
// https://github.com/react-navigation/react-navigation/issues/4886

/* eslint-disable no-unused-vars */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why you need this here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we were trying to avoid sending props that did not belong there to the View so we extract enabled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can prefix it with an underscore: _enabled and then eslint should throw this error.

}

export class NativeScreen extends React.Component<ScreenProps> {
render(): JSX.Element {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing render method on class-based react component seems redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason eslint warns if I remove it here, but it doesn't in index.native.tsx.

@WoLewicki WoLewicki force-pushed the @wolewicki/indexes-to-ts branch from e80b888 to 94d71d8 Compare March 1, 2021 14:02
@WoLewicki WoLewicki merged commit 76ecb0a into master Mar 2, 2021
@WoLewicki WoLewicki deleted the @wolewicki/indexes-to-ts branch March 2, 2021 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants