Skip to content

Latest commit

 

History

History

use-all-terms

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

useAllTerms

The useAllTerms hook is a simple utility that makes it easy to get all terms from a taxonomy.

Usage

import { useAllTerms } from '@10up/block-components';

function BlockEdit(props) {
    const [categories, hasResolvedCategories] = useAllTerms('category');

    if ( ! hasResolvedCategories ) {
        return <Spinner />
    }

    return (
        ...
    );
}