Skip to content

asafda/react-hover-prefetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A React high-order component for prefetching data on hovering actionable elements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published