Preact hook that imports a part of current state to the component.
This hook is preferred over useAppState. Unlike useAppState, useAppStateSelector will only trigger a component render when the selected value changes.
import { useAppStateSelector } from '@nosto/preact'export default () => { const query = useAppStateSelector(state => state.query) return <div> Searching for {query.query} </div>} Copy
import { useAppStateSelector } from '@nosto/preact'export default () => { const query = useAppStateSelector(state => state.query) return <div> Searching for {query.query} </div>}
Preact hook that imports a part of current state to the component.
This hook is preferred over useAppState. Unlike useAppState, useAppStateSelector will only trigger a component render when the selected value changes.