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

Refactor: PR #1 feedback #4

Merged
merged 15 commits into from
Jun 11, 2018
Merged

Refactor: PR #1 feedback #4

merged 15 commits into from
Jun 11, 2018

Conversation

samijaber
Copy link
Contributor

Overview

@samijaber samijaber self-assigned this Jun 8, 2018
@samijaber samijaber requested a review from OliverJAsh June 8, 2018 22:38
export const progressivelyEnhance = function<Props>(ComposedComponent: React.ComponentType<Props>) {
export const progressivelyEnhance = <Props extends {}>(
ComposedComponent: React.ComponentType<Props>,
) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To use generics with arrow functions in .tsx files, we have to do make the generic extend another type. This is so that TypeScript knows it's looking at a generic and not a JSX tag. Otherwise, the syntax will be ambiguous to the compiler 😕

See microsoft/TypeScript#4922

.vscode
.github
.editorconfig
.prettierrc
Copy link
Member

Choose a reason for hiding this comment

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

Instead of .npmignore you can specify a files whitelist inside package.json. Depends what you prefer!

@@ -6,16 +6,14 @@ indent_size = 2
trim_trailing_whitespace = true
Copy link
Member

Choose a reason for hiding this comment

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

Maybe a comment at the top to say that Prettier will inherit from here? E.g. https://github.com/unsplash/web-ops/blob/7352b543ae110247b005cb60226c6adf213401b1/.editorconfig#L1

@samijaber samijaber merged commit ac027e6 into master Jun 11, 2018
@samijaber samijaber deleted the refactor/pr1-feedback branch June 11, 2018 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants