Last active
February 13, 2017 16:17
-
-
Save windse7en/d6c8992e79363a9d9b31d133737b5950 to your computer and use it in GitHub Desktop.
Grid with attributes format
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; | |
Grid.Row = GridRow; | |
Grid.Column = GridColumn; | |
export default Grid; | |
// Consuming | |
import Gird from 'terra-grid'; | |
<Grid> | |
<Grid.Row> | |
<Grid.Column> | |
<p>test</p> | |
</Grid.Column> | |
</Grid.Row> | |
</Grid> | |
// Consuming with alias | |
import Grid from 'terra-grid'; | |
const Row = Grid.Row; | |
const Col = Grid.Column; | |
<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