-
Notifications
You must be signed in to change notification settings - Fork 333
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: pass insights
option default to undefined
#1198
Conversation
@@ -69,11 +69,11 @@ export function createAutocomplete< | |||
} | |||
|
|||
if ( | |||
options.insights && | |||
props.insights && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were previously using the passed option, not the defaulted one—this changes it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could also leave this as options
, and change getDefaultProps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it cleaner to always rely on props
as there's no ambiguity about what we're manipulating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat inconsistent with the other parts of the code which rely on options, but ok.
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 9bbfd17:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good with dhaya’s suggestion
@@ -69,11 +69,11 @@ export function createAutocomplete< | |||
} | |||
|
|||
if ( | |||
options.insights && | |||
props.insights && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat inconsistent with the other parts of the code which rely on options, but ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just needs @dhayab's doc update, but good to go other than that.
Co-authored-by: Dhaya <[email protected]>
This PR updates the
insights
option's default value toundefined
. This doesn't change any existing behavior, but lets us differentiate between an explicitfalse
value and the option being unset.https://algolia.atlassian.net/browse/FX-2642