A react hook to show in how many time that content could be read
yarn add use-reading-timenpm install --save use-reading-timepnpm add use-reading-timeimport React, { useRef } from 'react'
import Post from './post'
import useReadingTime from 'use-reading-time'
const Example = () => {
  const post = useRef()
  const {readingTime, wordsCount} = useReadingTime(post)
  return (
    <div>
      {readingTime} min • {wordsCount} words
      // Depending on the React version, you may need to use forwardRef
      <Post ref={post} />
    </div>
  )
}useReadingTime(reference, wordsPerMinute)| Argument | Description | Type | Default | Required | 
|---|---|---|---|---|
reference | 
A React ref object | Object | 
– | Yes | 
wordsPerMinute | 
Number of words we can read per minute | Number | 
260 (Source) | No | 
MIT © diogomoretti
