Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

reactime

Package Overview
Dependencies
Maintainers
12
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reactime

A library that helps debug React by memorizing the state of components with every render.

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
12
Weekly downloads
 
Created
Source

State Debugger for React

GitHub Build Status npm version Dependencies DevDependencies Vulnerabilities

Demo of Reactime

Reactime is a debugging tool for React developers. It records state whenever it is changed and allows the user to jump to any previously recorded state.

This dev tool is for React apps using stateful components and prop drilling, and has beta support for Context API, conditional state routing, Hooks (useState & useEffect) and functional components.

One thing to note is that this library does not work well when mixing React with direct DOM manipulation.

Two parts are needed for this tool to function. The chrome extension must be installed, and the NPM package must be installed and used in the React code.

After successfully installing the chrome extension, you can test Reactime functionalities in the demo repositories below.

Installing

  1. Download the extension from Chrome Web Store.

  2. Install the npm package in your code.

npm i reactime
  1. Call the library method on your root container after rendering your App.
const reactime = require('reactime');

const rootContainer = document.getElementById('root');
ReactDOM.render(<App />, rootContainer);

reactime(rootContainer);
  1. Done! That's all you have to do to link your React project to our library.

How to Use

After installing both the Chrome extension and the npm package, just open up your project in the browser.

Then open up your Chrome DevTools. There'll be a new tab called Reactime.

Features

Recording

Whenever state is changed (whenever setState or useState is called), this extension will create a snapshot of the current state tree and record it. Each snapshot will be displayed in Chrome DevTools under the Reactime panel.

Viewing

You can click on a snapshot to view your app's state. State can be visualized in a JSON or a tree. Also, snapshots can be diffed with the previous snapshot, which can be viewed under the Diff tab.

Jumping

Jumping is the most important feature of all. It allows you to jump to any previous recorded snapshots. Hitting the jump button on any snapshot will change the DOM by setting their state.

And Much More

  • multiple tree graph branches depicting state changes
  • tree graph hover functionality to view state changes
  • ability to pan and zoom tree graph
  • multiple tabs support
  • a slider to move through snapshots quickly
  • a play button to move through snapshots automatically
  • a pause button, which stops recording each snapshot
  • a lock button to freeze the DOM in place. setState will lose all functionality while the extension is locked
  • a persist button to keep snapshots upon refresh (handy when changing code and debugging)
  • export/import the current snapshots in memory

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Keywords

FAQs

Package last updated on 05 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc