Skip to content

Commit

Permalink
Improve comments around attribute migration effect
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 7, 2022
1 parent 9df8813 commit ed8aa33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/block-library/src/navigation/edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,9 @@ function Navigation( {
const isEntityAvailable =
! isNavigationMenuMissing && isNavigationMenuResolved;

// Migrate numerical ID-based ref to
// string slug-based ref.
// Migrate the numerical ID-based ref attribute to the
// string-based slug attribute. This action soft-deprecates
// usage of the ref attribute in favour of the slug attribute.
useEffect( () => {
if ( isEntityAvailable && isNumeric( ref ) ) {
setRef( navigationMenu?.slug );
Expand Down

0 comments on commit ed8aa33

Please sign in to comment.