react-hover-prefetch

0.0.6 • Public • Published

react-hover-prefetch · npm

Prefetch data on hover for better perceived performance.

Usage Example

react-hover-prefetch exports a single Prefetch component that fetches data upon mousenter, and invokes the requested action upon click.

There are no extra HTML elements added.

<Prefetch
  prefetch={this.prefetch}
  onClickAction={this.onClick}>
  <button>Click Me!</button>
</Prefetch>

Prefetch manages cases where the user clicks the button before or after the data was prefetched.

Installation

Via npm:

npm install react-hover-prefetch

Via Yarn:

yarn add react-hover-prefetch

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i react-hover-prefetch

    Weekly Downloads

    1

    Version

    0.0.6

    License

    MIT

    Last publish

    Collaborators

    • asafda