@expressive/babel-plugin-react-class
v1.0.0-beta.36
Published
Automatically extends React.Component for classes that include an Expressive-recognized render method.
Downloads
2
Readme
babel-plugin-auto-extends
Automatically extends classes with
React.Component
that contain a render method.
Install
npm install --save-dev @expressive-react/babel-plugin-auto-extends
.babelrc
Note that babel infers
babel-plugin
{
"plugins": [
"@expressive-react/auto-extends"
]
}
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.