Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 441 Bytes

File metadata and controls

21 lines (16 loc) · 441 Bytes

usePost

The usePost hook allows you to get information about the current post. It either references the global post, or when used within a <PostContext /> it reference that post.

Usage

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

function BlockEdit(props) {
    const {
        postId,
        postType,
        isEditable
    } = usePost();

    return (
        ...
    );
}