Skip to content

sonewman/react-component-list

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React-Component-List

Code Climate Build Status

Usage:

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>
 */

About

React Component List

Resources

Stars

Watchers

Forks

Packages

No packages published