2
0
mirror of https://github.com/tenrok/BBob.git synced 2026-06-05 16:42:27 +03:00

refactor(*): convert to babel and generation to lib, es, dist folders (#2)

* refactor(*): convert to babel and generation to lib, es, dist

* chore(*): remove generated files

* fix(*): lint run command
This commit is contained in:
Nikolay Kostyurin
2018-09-09 23:55:28 +02:00
committed by GitHub
parent d22a2895a4
commit 32a7fb51da
76 changed files with 930 additions and 10174 deletions
+25
View File
@@ -0,0 +1,25 @@
const React = require('react');
const PropTypes = require('prop-types');
const { render } = require('./render');
const content = (children, plugins) => React.Children.map(children, child =>
(typeof child === 'string' ? render(child, plugins) : child));
const Component = props =>
React.createElement(props.container, {}, content(props.children, props.plugins));
if (process.env.NODE_ENV !== 'production') {
Component.propTypes = {
container: PropTypes.node,
children: PropTypes.node.isRequired,
plugins: PropTypes.arrayOf(Function),
};
}
Component.defaultProps = {
container: 'span',
plugins: [],
};
export default Component;