from Hacker News

Show HN: React-hook-tracer – A light-weight tracer for React hooks

by oblosys on 11/4/22, 1:13 PM with 0 comments

The package allows you to trace hook events for a component by importing hooks from 'react-hook-tracer' instead of 'react', and adding a `useTracer` call to the component. Traced events include state/ref/context updates, effects being run, and components getting rendered. The `useTracer` hook also returns a `TracePanel` component, which shows the current values of props, state & refs in the component's rendering.

Demo playground: https://codesandbox.io/s/github/Oblosys/react-hook-tracer/tr...