Skip to content

Commit 1253d25

Browse files
committed
Use Symbol for CollaborationMode slot name
Changes the CollaborationMode SlotFill to use a Symbol instead of a string for the slot name. This makes the slot truly private by ensuring only code with a reference to the exported Fill/Slot components can access it. String-based slot names can be accessed by anyone who knows the name. Using Symbol() prevents unauthorized usage and follows the pattern established in PR WordPress#67238.
1 parent c30da49 commit 1253d25

File tree

1 file changed

+1
-1
lines changed
  • packages/editor/src/components/collaboration-mode

1 file changed

+1
-1
lines changed

packages/editor/src/components/collaboration-mode/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
import { createSlotFill } from '@wordpress/components';
55

6-
const { Fill, Slot } = createSlotFill( 'CollaborationMode' );
6+
const { Fill, Slot } = createSlotFill( Symbol( 'CollaborationMode' ) );
77

88
/**
99
* Renders the SlotFill for collaboration mode.

0 commit comments

Comments
 (0)