/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-editor/src/components/provider/selection-context.js
16 строк
613 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { createContext } from '@wordpress/element'; const noop = () => {}; /** * Context for coordinating selection state between the editor and block sync. * * - `getSelection`: Stable getter that reads selection from entity edits imperatively. * Using a getter instead of a value avoids re-rendering the entire * block editor tree on every keystroke. * - `onChangeSelection`: Callback to report selection changes with external IDs back to the entity. */ export const SelectionContext = createContext( { getSelection: () => undefined, onChangeSelection: noop, } );