packages/components/src/post-select/index.js
Function usePostOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const usePostOptions = ( postType = 'course' ) => {
const { posts, currentPostType } = useSelect( ( select ) => {
return {
posts: select( 'core' ).getEntityRecords( 'postType', postType ),
currentPostType: select( 'core/editor' )?.getCurrentPostType(),