Skip to content

Instantly share code, notes, and snippets.

@windse7en
Last active February 14, 2017 21:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save windse7en/87c2c74e29b28b15ba2e7d0b5d0273a9 to your computer and use it in GitHub Desktop.
Save windse7en/87c2c74e29b28b15ba2e7d0b5d0273a9 to your computer and use it in GitHub Desktop.
Grid export into multiple components.
import React, { PropTypes } from 'react';
import GridRow from '../src/GridRow';
import GridColumn from '../src/GridColumn';
import '../src/grid.scss';
const propTypes = {
children: PropTypes.node.isRequired,
};
const Grid = props => (<div {...props} />);
Grid.propTypes = propTypes;
export { Grid, GridRow, GridColumn };
// Consuming
import { Gird, GridRow, GridColumn } from 'terra-grid';
<Grid>
<GridRow>
<GridColumn>
<p>test</p>
</GridColumn>
</GridRow>
</Grid>
// Consuming with alias
import { Gird, GridRow as Row, GridColumn as Col } from 'terra-grid';
<Grid>
<Row>
<Col>
<p>test</p>
</Col>
</Row>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment