Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(Flow Types): Fixed Flow typing to allow for omitting options when using the options param #315

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

Open
FermiDirak wants to merge 1 commit into algolia:master
base: master
Choose a base branch
Loading
from FermiDirak:master

Conversation

Copy link

@FermiDirak FermiDirak commented Oct 19, 2018
edited
Loading

Currently options are an all or nothing parameter. This means if you want to specify the tabStop, you must specify every other option if using Flow. This PR splits the Options type to OptionParams and Options so that options can be independently specified when using the options param.

This comment has been minimized.

@FermiDirak FermiDirak changed the title (削除) Fixed Flow typing to allow for omitting options when using the options param (削除ここまで) (追記) fix(Flow Types): Fixed Flow typing to allow for omitting options when using the options param (追記ここまで) Oct 19, 2018
...plit the Options type to OptionParams and Options so that properties can be independently specified in options
Copy link
Author

FermiDirak commented Oct 19, 2018
edited
Loading

I'm open to adding tests for this PR

Copy link
Contributor

vvo commented Oct 19, 2018

@FermiDirak why not just updating the already in place Options type definition (warning: I am new to Flow)

SachsKaylee reacted with thumbs up emoji

Copy link
Author

FermiDirak commented Oct 19, 2018
edited
Loading

@vvo Flow isn't able to infer default values in a function signature, so when you consume reactElementToJsxString and use Flow, the Options argument must be specified with all its properties defined.

The problem with updating the Options type is that some of the methods in the library require all of optionss properties to be defined. The way to circumvent Flow not inferring defaults is to create a separate type for the function signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /