Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 450 Bytes

File metadata and controls

21 lines (15 loc) · 450 Bytes

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 (
        ...
    );
}