Skip to content

Commit

Permalink
Remove useRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo committed Jun 14, 2024
1 parent 904391f commit eac1559
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import clsx from 'clsx';
* WordPress dependencies
*/
import { Platform, useRef, useCallback, forwardRef } from '@wordpress/element';
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
import { useDispatch, useSelect } from '@wordpress/data';
import {
pasteHandler,
children as childrenSource,
Expand Down Expand Up @@ -105,7 +105,6 @@ export function RichTextWrapper(
providedRef
) {
const instanceId = useInstanceId( RichTextWrapper );
const registry = useRegistry();

identifier = identifier || instanceId;

Expand Down Expand Up @@ -542,11 +541,9 @@ export function RichTextWrapper(
const currentSelection = findSelection( [ block ] );
onReplace( [ block ] );
selectionChange( ...currentSelection );
registry
.dispatch( blockEditorStore )
.__unstableMarkAutomaticChange();
__unstableMarkAutomaticChange();
},
[ onReplace, start, selectionChange, registry ]
[ onReplace, start, selectionChange, __unstableMarkAutomaticChange ]
);

const mergedRef = useMergeRefs( [ providedRef, fallbackRef ] );
Expand Down

0 comments on commit eac1559

Please sign in to comment.