UNPKG

react-toolbox-build4server

Version:

Builds react-toolbox in such a way that it's components can be required and used in node - most likely for server-side rendered webapps - without having to depend on webpack to build your entire server-side project

23 lines (18 loc) 558 B
import React from 'react'; import style from './style'; import ListItemAction from './ListItemAction'; const ListItemActions = ({type, children}) => { const validChildren = React.Children.toArray(children).filter(c => ( React.isValidElement(c) )); return ( <span className={style[type]}> {validChildren.map((action, i) => <ListItemAction key={i} action={action} />)} </span> ); }; ListItemActions.propTypes = { children: React.PropTypes.any, type: React.PropTypes.oneOf(['left', 'right']) }; export default ListItemActions;