Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

fix(vue 3): provide default value for injected data #997

Closed

Conversation

eunjae-lee
Copy link
Contributor

Summary

This PR adds default value for getProvidedParentIndex. Without default value, we get this warning messages:

[Vue warn]: injection "$_ais_getParentIndex" not found. 

@eunjae-lee eunjae-lee requested a review from Haroenv June 9, 2021 12:57
@eunjae-lee eunjae-lee added this to the Vue 3 milestone Jun 9, 2021
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 9, 2021

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 d264846:

Sandbox Source
vue-instantsearch-e-commerce Configuration

getProvidedParentIndex: '$_ais_getParentIndex',
getProvidedParentIndex: {
from: '$_ais_getParentIndex',
default: undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

the default parent index should be InstantSearchInstance.mainIndex

@@ -11,7 +11,10 @@ export const createWidgetMixin = ({ connector } = {}) => ({
);
},
},
getProvidedParentIndex: '$_ais_getParentIndex',
getProvidedParentIndex: {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
getProvidedParentIndex: {
getParentIndex: {

@eunjae-lee
Copy link
Contributor Author

@Haroenv I'm closing this PR. It was a modification based on this workaround but now that I opened a PR for the fix on Vue.js side, it will resolve our issue.

Sorry for your time!

@eunjae-lee eunjae-lee closed this Jun 9, 2021
@eunjae-lee eunjae-lee deleted the feat/v3-compat-inject-default branch June 10, 2021 09:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants