svf
Version:
A simple validate form and React-based implementation
23 lines (20 loc) • 434 B
JavaScript
import React from "react";
const Row = ({ children, ...otherProps }) => {
const length = children.length;
const className = `col-1-${ typeof length === "number" ? length : 1 }`;
return (
<div className="row">
{
children ? (
React.Children.map(children, (child) => {
return React.cloneElement(child, {
...otherProps,
className
});
})
) : ""
}
</div>
)
};
export default Row;