API Reference
  • Introduction
  • 💻CLI Commands
    • Create commands
      • create
      • create-package
    • Run commands
      • dev
      • serve
    • Build commands
      • build
    • Extra commands
  • 🍱Packages
    • 💙Core package
      • frontity
    • ⚡Features packages
      • @frontity/wp-source
      • @frontity/tiny-router
      • @frontity/html2react
      • @frontity/head-tags
      • @frontity/yoast
      • @frontity/google-ad-manager
      • @frontity/smart-adserver
      • analytics packages
        • @frontity/google-analytics
        • @frontity/google-tag-manager-analytics
        • @frontity/comscore-analytics
      • @frontity/wp-comments
    • 📚Collections packages
      • @frontity/components
      • @frontity/hooks
        • Infinite Scroll Hooks
        • Intersection Observer Hooks
    • 🎨Themes Packages
      • @frontity/twentytwenty-theme
      • @frontity/mars-theme
  • 🔌WordPress Plugins
    • REST API - Head Tags
    • Frontity Embedded Mode
Powered by GitBook
On this page
  • Table of Contents
  • Installation
  • How to use
  • Hooks

Was this helpful?

  1. Packages
  2. Collections packages

@frontity/hooks

API reference of `@frontity/hooks` package

Previous@frontity/componentsNextInfinite Scroll Hooks

Last updated 4 years ago

Was this helpful?

This package is a collection of React hooks that have proven to be pretty useful for a Frontity project.

Table of Contents

Installation

Add the @frontity/hooks package to your project:

npm i @frontity/hooks

How to use

In order to use it, you just have to import the hook you want to use in your theme from @frontity/hooks and place it wherever needed. For example, if we want to use the useInView hook:

import useInView from "@frontity/hooks/use-in-view";

Hooks

These are the hooks available from the package @frontity/hooks

🍱
📚
Intersection Observer Hooks
Infinite Scroll Hooks
Installation
How to use
Hooks
useInView
useInfiniteScroll
useArchiveInfiniteScroll
usePostTypeInfiniteScroll