Skip to content

Commit

Permalink
Block Editor: Rename block context in BlockListBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Apr 28, 2020
1 parent 229f0b0 commit 286281c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useSelect, useDispatch } from '@wordpress/data';
import { isInsideRootBlock } from '../../utils/dom';
import useMovingAnimation from './moving-animation';
import { Context, BlockNodes } from './root-container';
import { BlockContext } from './block';
import { BlockListBlockContext } from './block';
import ELEMENTS from './block-elements';

const BlockComponent = forwardRef(
Expand All @@ -50,7 +50,7 @@ const BlockComponent = forwardRef(
mode,
blockTitle,
wrapperProps,
} = useContext( BlockContext );
} = useContext( BlockListBlockContext );
const { initialPosition } = useSelect(
( select ) => {
if ( ! isSelected ) {
Expand Down
6 changes: 3 additions & 3 deletions packages/block-editor/src/components/block-list/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import BlockCrashBoundary from './block-crash-boundary';
import BlockHtml from './block-html';
import { Block } from './block-wrapper';

export const BlockContext = createContext();
export const BlockListBlockContext = createContext();

function BlockListBlock( {
mode,
Expand Down Expand Up @@ -167,7 +167,7 @@ function BlockListBlock( {
const memoizedValue = useMemo( () => value, Object.values( value ) );

return (
<BlockContext.Provider value={ memoizedValue }>
<BlockListBlockContext.Provider value={ memoizedValue }>
<BlockCrashBoundary onError={ onBlockError }>
{ isValid && lightBlockWrapper && (
<>
Expand Down Expand Up @@ -199,7 +199,7 @@ function BlockListBlock( {
<BlockCrashWarning />
</Block.div>
) }
</BlockContext.Provider>
</BlockListBlockContext.Provider>
);
}

Expand Down

0 comments on commit 286281c

Please sign in to comment.