UNPKG

@gechiui/block-editor

Version:
32 lines (30 loc) 809 B
import { createElement } from "@gechiui/element"; /** * GeChiUI dependencies */ import { useMemo } from '@gechiui/element'; /** * Internal dependencies */ import Edit from './edit'; import { BlockEditContextProvider, useBlockEditContext } from './context'; export { useBlockEditContext }; export default function BlockEdit(props) { const { name, isSelected, clientId } = props; const context = { name, isSelected, clientId }; return createElement(BlockEditContextProvider // It is important to return the same object if props haven't // changed to avoid unnecessary rerenders. // See https://reactjs.org/docs/context.html#caveats. , { value: useMemo(() => context, Object.values(context)) }, createElement(Edit, props)); } //# sourceMappingURL=index.js.map