import { useNostoAppState } from '@nosto/search-js/preact'
export default () => {
const pageType = useNostoAppState(state => state.pageType)
return (
<div>
Page type is {pageType}
</div>
)
}
If the selector parameter is not provided, the full state is returned. Be mindful of the unnecessary rerenders it may cause.
Imports a part of the Nosto state to the component.
import { useNostoAppState } from '@nosto/search-js/preact'
export default () => {
const pageType = useNostoAppState(state => state.pageType)
return (
<div>
Page type is {pageType}
</div>
)
}
If the selector parameter is not provided, the full state is returned. Be mindful of the unnecessary rerenders it may cause.
Imports a part of the Nosto state to the component.