Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rewrite indexes to TS #794

Merged
merged 6 commits into from
Mar 2, 2021
Merged

feat: rewrite indexes to TS #794

merged 6 commits into from
Mar 2, 2021

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

Sorry, something went wrong.

@WoLewicki WoLewicki mentioned this pull request Jan 28, 2021
3 tasks
const { enabled = true } = this.props;

if (!ENABLE_SCREENS || !enabled) {
// Filter out active prop in this case because it is unused and
// can cause problems depending on react-native version:
// 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.

None yet

3 participants