@tinypixelco/wp-react-hooks
Overview
Block
Post
Editor
Data
useBlockEditorStoreImportUsage

useBlockEditorStore

The useBlockEditorStore hook wraps select and dispatch on the core/block-editor store.

It is primarily intended to be used internally by wp-react-hooks, but it is also fine to import it.

Import

import {useBlockEditorStore} from '@tinypixelco/wp-react-hooks'

Usage

const {select, dispatch} = useBlockEditorStore()

Source

import {select, dispatch} from '@wordpress/data'
const useBlockEditorStore = () => ({
select: select('core/block-editor'),
dispatch: dispatch('core/block-editor'),
})
export {useBlockEditorStore}