@stijnvanhulle/babel-plugin-hooks-devtools
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

@stijnvanhulle/babel-plugin-hooks-devtools

Babel plugin to debug useState and useEffect inside of the redux devtools

Getting Started

To begin, you'll need to install @stijnvanhulle/babel-plugin-hooks-devtools:

$ npm install @stijnvanhulle/babel-plugin-hooks-devtools --save-dev

babel.config.js

module.exports = {
  plugins: {
    [
      "@stijnvanhulle/babel-plugin-hooks-devtools",
      {
        active: true,
      },
    ]
  },
};

And debug comment in front of the useEffect/useState that you want to debug

const [isOpen, setIsOpen] = useState(false);
// debug
useEffect(() => {
  setIsOpen((value) => !value);
}, [isOpen]);

Examples

Initial load

Changes happening in the useEffect hook

Readme

Keywords

none

Package Sidebar

Install

npm i @stijnvanhulle/babel-plugin-hooks-devtools

Weekly Downloads

0

Version

0.1.3

License

MIT

Unpacked Size

41.5 kB

Total Files

25

Last publish

Collaborators

  • stijnvanhulle