package react-rules-of-hooks-ppx

  1. Overview
  2. Docs
On This Page
  1. 1.0.0
This ppx validates the rules of React hooks in reason-react components

Install

dune-project
 Dependency

Authors

Maintainers

Sources

react-rules-of-hooks-ppx-1.0.0.tbz
sha256=6b7fdca0f32c2f05f1480db5a0b85e0726cdb1ed3d7136054a4071b4d41a8188
sha512=18b51e6a70b6cfa31cc00e8f5601ed6fe85456c5388dc41f1cc7ed21830b8ca737f3e1dff47f8736aa5553b0e463f6f8dcac165e328b5c0a1590507e1bd3ed3d

doc/CHANGES.html

Changes

1.0.0

  • Detect hooks called conditionally, in loops, or in nested functions
  • Detect hooks called outside of [@react.component] functions or custom hooks
  • Check exhaustive dependencies in useEffect, useMemo, useCallback, useLayoutEffect, and useInsertionEffect
  • Disable order of hooks check globally with -order-of-hooks ppx flag
  • Disable exhaustive deps check globally with -exhaustive-deps ppx flag
  • Suppress exhaustive deps warning locally with [@disable_exhaustive_deps] attribute
  • -corrections flag to generate .ppx-corrected files with suggested fixes for missing dependencies
  • Improve -corrections according to the reason-react interface