|
Download wp-calypso/client/components/data/media-list-data/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.27 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/media-list-data/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/components/data/media-list-data/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/components/data/media-list-data/README.md
1.27 kB
MediaListData
MediaListData is a React component intended to be used as a controller-view to simplify binding and interacting with the media stores and actions.
Usage
Wrap a child component with <MediaListData />, passing a siteId and optional filter, postId and search values. As a controller-view, MediaListData does not render any content of its own; instead, it simply renders the child component.
import MediaListData from 'calypso/components/data/media-list-data';
import MyChildComponent from './my-child-component';
export default class extends React.Component {
static displayName = 'MyComponent';
render() {
return (
<MediaListData siteId={ this.props.siteId }>
<MyChildComponent />
</MediaListData>
);
}
}
The child component should expect to receive any props defined during the render, as well as the following additional props:
media: An ordered array of known media items for the site, orundefinedif currently fetching datamediaHasNextPage: A boolean indicating whether more media items exist for the sitemediaOnFetchNextPage: A function to invoke when more media items are desired