Skip to content

Latest commit

 

History

History

use-is-plugin-active

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

useIsPluginActive

The useIsPluginActive hook is a simple utility that returns whether or not a given plugin is activated.

Usage

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

function BlockEdit(props) {
    const [isYoastSeoActive, hasResolvedIsPluginActive] = useIsPluginActive('wordpress-seo/wp-seo');

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

    return (
        ...
    );
}