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