Last active
February 14, 2017 21:15
-
-
Save windse7en/87c2c74e29b28b15ba2e7d0b5d0273a9 to your computer and use it in GitHub Desktop.
Grid export into multiple components.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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