Skip to content

Commit

Permalink
Add doc for WordCount component (WordPress#62217)
Browse files Browse the repository at this point in the history
  • Loading branch information
amitraj2203 authored and patil-vipul committed Jun 17, 2024
1 parent 73545b8 commit 7200573
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,11 @@ Undocumented declaration.
### WordCount

Undocumented declaration.
Renders the word count of the post content.

_Returns_

- `JSX.Element|null`: The rendered WordCount component.

### WritingFlow

Expand Down
5 changes: 5 additions & 0 deletions packages/editor/src/components/word-count/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import { count as wordCount } from '@wordpress/wordcount';
*/
import { store as editorStore } from '../../store';

/**
* Renders the word count of the post content.
*
* @return {JSX.Element|null} The rendered WordCount component.
*/
export default function WordCount() {
const content = useSelect(
( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),
Expand Down

0 comments on commit 7200573

Please sign in to comment.