Preact hook that import current actions to the component. Actions should be used to modify state, making new searches, etc.
import { useActions } from '@nosto/search-js/preact/hooks'export default () => { const { newSearch } = useActions() return <button onClick={() => { newSearch({ query: { query: "shoes" } }) }}> Search for "shoes" </button>} Copy
import { useActions } from '@nosto/search-js/preact/hooks'export default () => { const { newSearch } = useActions() return <button onClick={() => { newSearch({ query: { query: "shoes" } }) }}> Search for "shoes" </button>}
Preact hook that import current actions to the component. Actions should be used to modify state, making new searches, etc.