Skip to content

Update the state outside autocomplete init #1048

Answered by Haroenv
GilbertHG asked this question in Q&A
Discussion options

You must be logged in to vote

Is there a reason you don't use a single instance for both with detached mode?

You can use const instance2 = autocomplete({onStateChange(state => instance1.setXXX(state.xxx))}) (depending on what you want to set, setters are documented here: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/state/#setters)

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@GilbertHG
Comment options

Answer selected by GilbertHG
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants