Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified

Query Email Stats

<QueryEmailStats /> is a React component used in managing network requests for email stats.

Usage

Render the component, passing siteId, postId and fields. It does not accept any children, nor does it render any elements to the page. You can use it adjacent to other sibling components which make use of the fetched data made available through the global application state.

import QueryEmailStats from 'calypso/components/data/query-email-stats';

export default function Component( { statValue } ) {
    return (
        <div>
            <QueryEmailStats siteId={ 3584907 } postId={ 4533 } fields={ [ 'views' ] } />
            <div>{ statValue }</div>
        </div>
    );
}

Props

siteId

TypeNumber
RequiredNo

The site ID for which the email stat should be requested.

postId

TypeNumber
RequiredNo

The post ID for which the email stat should be requested.

fields

TypeString
RequiredNo

The stats fields being requested.