babel-plugin-infer-extends-component

Automatically extends React.Component for classes that include render method

Moved to @expressive-react/babel-plugin-auto-extends
Last updated 2 years ago by gabeklein .
MIT · Original npm · Tarball · package.json
$ cnpm install babel-plugin-infer-extends-component 
SYNC missed versions from official npm registry.

infer-extends-component

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

Install

npm install --save-dev babel-plugin-infer-extends-component

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.

Current Tags

  • 1.1.0                                ...           latest (2 years ago)

3 Versions

  • 1.1.0 [deprecated]           ...           2 years ago
  • 1.0.1 [deprecated]           ...           2 years ago
  • 1.0.0 [deprecated]           ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (1)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |