Description
Haunted is a library that brings React's Hooks API to standard web components. It works with lit-html or hyperHTML for rendering. Components are written as functions that use hooks, so the patterns used in React apps carry over to web components. Haunted supports useCallback, useContext, useController, useEffect, useLayoutEffect, useMemo, useReducer, useRef and useState. Because the API matches React's, the README suggests you can reuse hooks published on npm by aliasing their package names in your bundler's config. The README links to the documentation and to a gist with more example integrations, and it documents the function signatures for each hook. Haunted is released under the BSD-2-Clause license, and its source is public on GitHub.…
Highlights
- React Hooks API for web components
- Works with lit-html or hyperHTML
- useState, useEffect, useReducer and more
- Reuse npm hooks by aliasing packages
- BSD-2-Clause license
Ratings & Reviews
No ratings yet
Be the first to rate haunted.
People also visit
haunted FAQ
What is Haunted?
A library that implements React's Hooks API for standard web components, using lit-html or hyperHTML for rendering.
Which hooks are supported?
useCallback, useContext, useController, useEffect, useLayoutEffect, useMemo, useReducer, useRef and useState.
Can I reuse React hooks from npm?
The README says the API matches React's, so you can alias the package names in your bundler's config to reuse hooks from npm.
Where can I find the docs?
The README links to the documentation and to a gist with more example integrations.
What license is it under?
BSD-2-Clause, as stated in the README.
What are the best haunted alternatives?
Popular alternatives to haunted include pion, @tryvital/vital-link and shadcnhooks. See all haunted alternatives












