Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support "component" prop for grid areas #7

Closed
kettanaito opened this issue May 30, 2018 · 2 comments
Closed

Support "component" prop for grid areas #7

kettanaito opened this issue May 30, 2018 · 2 comments
Labels
enhancement New feature or request needs:discussion Further information is requested
Milestone

Comments

@kettanaito
Copy link
Owner

What

Need to add the support for component prop to grid area components.

Why

At the moment all grid areas will render <div> elements. That may not be the desired layout in some cases. For example, sometimes passing a presentational component as the component prop may simplify the layout declaration:

import React from 'react'
import ArticleHeader from './ArticleHeader'

const template = `
  'header'
`

const Article = () => (
<Layout template={template}>
  {({ Header }) => (
    <React.Fragment>
      <Header component={ArticleHeader} />
    </React.Fragment>
  )}
</Layout>
)

export default Article
@kettanaito
Copy link
Owner Author

kettanaito commented May 30, 2018

On the other hand, this may encourage the usage of presentational component instead of grid areas. That is not intended and goes against the atomic layout principles (it's similar as mixing Bootstrap grid classes with your own classes, which is a bad idea).

@kettanaito kettanaito added enhancement New feature or request needs:discussion Further information is requested labels May 31, 2018
@kettanaito kettanaito added this to the Optimization milestone Jun 17, 2018
@kettanaito
Copy link
Owner Author

There is not going to be a support for this feature, at least for now. The reasoning is written in the previous comment (that is to discourage a tight coupling between grid area and a presentational component inside it). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs:discussion Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant