@omni-door/tpl-component-library-react
Version:
The React component-library-react project template
8 lines (7 loc) • 908 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function default_1(config) {
var ts = config.ts, componentName = config.componentName, style = config.style;
return "import React, { PureComponent } from 'react';\n" + (style ? "import './style/" + componentName + "." + (style === 'all' ? 'less' : style) + "';" : '') + "\n\n" + (ts ? "export interface " + componentName + "Props {}\n\nexport interface " + componentName + "States {}" : '') + "\n\nexport class " + componentName + " extends PureComponent" + (ts ? "<" + componentName + "Props, " + componentName + "States>" : '') + " {\n " + (ts ? 'public ' : '') + "render() {\n const { children } = this.props;\n\n return (\n <div\n className='" + componentName + "'\n >\n { children }\n </div>\n );\n }\n}\n\nexport default " + componentName + ";";
}
exports.default = default_1;