import React, {PropTypes} from 'react';
import {renderToStaticMarkup} from 'react-dom/server';
import createList from 'react-component-list';
const Wrapper = ({children}) => <ul>{children}</ul>;
Wrapper.propTypes = { children: PropTypes.node.isRequired };
const ComponentList = createList(Wrapper);
ComponentList.push(<li>{'abc'}</li>);
ComponentList.push(<li>{'def'}</li>);
ComponentList.push(<li>{'ghi'}</li>);
renderToStaticMarkup(<ComponentList />);
/**
* <ul>
* <li>abc</li>
* <li>def</li>
* <li>ghi</li>
* </ul>
*/
-
Notifications
You must be signed in to change notification settings - Fork 0
sonewman/react-component-list
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|