Skip to content

Commit

Permalink
Export useBlockPreview as __experimentalUseBlockPreview
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Dec 3, 2021
1 parent dc6ef50 commit 154266a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 19 deletions.
17 changes: 0 additions & 17 deletions packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,23 +664,6 @@ _Returns_

Undocumented declaration.

### useBlockPreview

This hook is used to lightly mark an element as a block preview wrapper
element. Call this hook and pass the returned props to the element to mark as
a block preview wrapper, automatically rendering inner blocks as children. If
you define a ref for the element, it is important to pass the ref to this
hook, which the hook in turn will pass to the component through the props it
returns. Optionally, you can also pass any other props through this hook, and
they will be merged and returned.

_Parameters_

- _options_ `Object`: Preview options.
- _options.blocks_ `WPBlock[]`: Block objects.
- _options.props_ `Object`: Optional. Props to pass to the element. Must contain the ref if one is defined.
- _options.\_\_experimentalLayout_ `Object`: Layout settings to be used in the preview.

### useBlockProps

This hook is used to lightly mark an element as a block element. The element
Expand Down
5 changes: 4 additions & 1 deletion packages/block-editor/src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ export { default as BlockList } from './block-list';
export { useBlockProps } from './block-list/use-block-props';
export { LayoutStyle as __experimentalLayoutStyle } from './block-list/layout';
export { default as BlockMover } from './block-mover';
export { default as BlockPreview, useBlockPreview } from './block-preview';
export {
default as BlockPreview,
useBlockPreview as __experimentalUseBlockPreview,
} from './block-preview';
export {
default as BlockSelectionClearer,
useBlockSelectionClearer as __unstableUseBlockSelectionClearer,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/post-template/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useSelect } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import {
BlockContextProvider,
useBlockPreview,
__experimentalUseBlockPreview as useBlockPreview,
useBlockProps,
useInnerBlocksProps,
store as blockEditorStore,
Expand Down

0 comments on commit 154266a

Please sign in to comment.