1.1.3 • Published 2 years ago

use-print-text v1.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Use Print Text

This is a simple custom hook that prints text with an adjustable delay.

Node CI

Installation

npm install use-print-text

Usage

Hook returns ref.

import { usePrintText } from 'use-print-text';

const Component = () => {
    const divRef = usePrintText('foo', 200, {once: false, startDelay: 3000})
    
    return (
        <div ref={divRef} />
    );
}

Syntax

usePrintText(text, delay, options)

Parameters

  • text String to printed.
  • delay To delay printing. (default 200)

  • options (optional)

    • once(default false)
      • true Will print once even after re-rendering the parent component.
      • false The print will re-render along with the parent component's render.
    • startDelay Delay before printing. (default 500)
1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago