Skip to content

Commit

Permalink
Use named functions without attributing them to const
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Aug 8, 2024
1 parent 432635b commit cb6485c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/components/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ The following example implements all of the above recommendations.
//=======================
import { forwardRef, createContext } from '@wordpress/element';

const UnforwardedTopLevelComponent = function TopLevel( props, ref ) {
function UnforwardedTopLevelComponent( props, ref ) {
/* ... */
};
}
const TopLevelComponent = forwardRef( UnforwardedTopLevelComponent );

const UnforwardedSubComponent = function Sub( props, ref ) {
function UnforwardedSubComponent( props, ref ) {
/* ... */
};
}
const SubComponent = forwardRef( UnforwardedSubComponent );
SubComponent.displayName = 'Component.SubComponent';

Expand Down

0 comments on commit cb6485c

Please sign in to comment.