logo

What is React Hookify?

  • Command Line tool that converts React class components into functional components with Hooks
  • A quick way to refactor old code
  • A useful tool to learn more about React hooks

Why?

  • Keep up to date with the most recent React additions
  • Use stateful logic within functional components
  • Avoid React "Wrapper-Hell"

Installation

Install React Hookify's source files globally via npm.
$ npm install -g react-hookify

Usage

Use the 'hookify' command to create a functional component equivalent in a newly created file.
$ hookify <filepath of class component>