1. Home.
  2. Projects.
  3. Blog.
  4. Snippets.
  5. About.
Resume
  1. Home
  2. Projects
  3. Blog
  4. Snippets
  5. About
Resume

Snippets

Here is a collection of code snippets which you may find useful.

  • Next.js SEO component

    A re-useable component to ease the pain of entering SEO meta tags.

  • React.js useDebounce Hook

    A useful React hook for debouncing a string.

  • React.js useIsInViewport Hook

    React hook which reports if an element is in viewport.

  • React.js useMediaQuery Hook

    Custom React.js hook that watches for certain breakpoints.

  • React.js useOnClickOutside Hook

    React hook which listens for clicks outside of a specified element.

  • React.js useOnScreen Hook

    React hook which reports if an element is in screen view.

  • React.js usePagination Hook

    Custom React.js hook used for client-side pagination.

  • Validate an email address with JavaScript RegEx.

    A useful function to determine whether a string is a valid email address or not.

© Perry Smith-Moss 2026