0.2.0 • Published 2 years ago

babel-plugin-remove-react-fc-and-vfc v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

babel-plugin-remove-react-fc-and-vfc

release License: MIT npm version

This plugin removes React.VFC and React.FC annotation.

Input:

const Component: React.FC<Props> = (props) => {
  return <div>{props.value}</div>;
};

Output:

const Component = (props: Props) => {
  return <div>{props.value}</div>;
};

Why?

As React.XXX is modified frequently like React.SFC was removed or the children type will be removed from React.FC, I think we should not use React.XXX type as much as possible.

See more details

Install

$ npm install --save-dev babel-plugin-remove-react-fc-and-vfc

and add it to your .babelrc.

{
  "plugins": ["remove-react-fc-and-vfc"]
}

Contributing

Welcome your contribution!

See also Babel Plugin Handbook.

Setup

$ git clone git@github.com:nissy-dev/babel-plugin-remove-react-fc-and-vfc.git
$ cd babel-plugin-remove-react-fc-and-vfc
$ npm ci

Development Tools

// run tsc, eslint, prettier
$ npm run lint

// run test
$ npm run test
0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

3 years ago

0.0.1

3 years ago