This package has been deprecated

Author message:

Moved to @expressive-react/babel-plugin-auto-extends

babel-plugin-infer-react-class

1.2.1 • Public • Published

infer-react-class

Automatically extends classes with React.Component that contain a render method.

Install

npm install --save-dev babel-plugin-infer-react-class

Before

import React from "react";

class FooBar {
    render(){
        return (
            <div>Hello World!</div>
        )
    }
}

After

import React from "react";

class FooBar extends React.Component {
    render(){
        return (
            <div>Hello World!</div>
        )
    }
}

Override

If you do not want to extend Component simply extending any other class will work. Classes extending undefined explicitely will not extend anything even if they would otherwise trigger the transform.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Published

Version History

  • Version
    Downloads (Last 7 Days)
    • Published

Package Sidebar

Install

npm i babel-plugin-infer-react-class

Weekly Downloads

2

Version

1.2.1

License

MIT

Unpacked Size

12.1 kB

Total Files

5

Last publish

Collaborators

  • gabeklein