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

DEV: fix incorrect optional chain usages #1069

Merged
merged 4 commits into from Jun 29, 2019

Conversation

@mrtnzlml
Copy link
Member

commented May 29, 2019

This Pull Request meets the following criteria:

@@ -54,7 +54,7 @@ class CardSectionContent extends React.Component<Props, State> {
contentHeight: 0,
};

node: { current: any | HTMLDivElement } = React.createRef();

This comment has been minimized.

Copy link
@mrtnzlml

mrtnzlml May 29, 2019

Author Member

This is wrong everywhere you use { current: any | Something }, see: https://github.com/facebook/flow/blob/85d2868c64f62e4d4bb173f554be37fb976cb9e6/lib/react.js#L246-L247. I left it everywhere where it uncovered additional bugs. Maybe worth checking it.

@vepor vepor changed the title Flow: fix incorrect optional chain usages DEV: fix incorrect optional chain usages May 29, 2019

@vepor

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

Thanks @mrtnzlml. Just out of curiosity, is it incorrect usage, or just unnecessary? I believe that we needed to use it in previous versions of flow.

@mrtnzlml

This comment has been minimized.

Copy link
Member Author

commented Jun 5, 2019

@vepor Could be considered unnecessary, yes. Even the lint is called like this. I am more strict with myself so this is incorrect for me... 😊

I think this combo of optional chaining and unnecessary chain lint works like this from the beginning.

Merge remote-tracking branch 'origin/master' into flow-unnecessary-op…
…tional-chain

# Conflicts:
#	src/Tooltip/index.js
@mrtnzlml

This comment has been minimized.

Copy link
Member Author

commented Jun 26, 2019

What about this? :)

tomashapl added 2 commits Jun 28, 2019
Merge remote-tracking branch 'origin/master' into flow-unnecessary-op…
…tional-chain

# Conflicts:
#	src/Modal/index.js

@tomashapl tomashapl merged commit 6522be2 into master Jun 29, 2019

2 checks passed

ci/circleci: deploy-surge Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details

@tomashapl tomashapl deleted the flow-unnecessary-optional-chain branch Jun 29, 2019

tomashapl added a commit that referenced this pull request Aug 13, 2019
DEV: fix incorrect optional chain usages (#1069)
* Flow: fix incorrect optional chain usages

* fix flow
tomashapl added a commit that referenced this pull request Aug 13, 2019
DEV: fix incorrect optional chain usages (#1069)
* Flow: fix incorrect optional chain usages

* fix flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.