Skip to content

Changed bloql interface to avoid polluting `this.props` object and make it easier to access for posts

Latest
Compare
Choose a tag to compare
@adriantoine adriantoine released this 12 Oct 12:00
· 4 commits to master since this release
  • Changed bloql interface to avoid polluting this.props object and make it easier to access for posts:

    for PostList:

    {this.props.posts.edges.map(edge =>
    <a href={edge.node.meta.slug}>{edge.node.meta.title}</a>
    )}
    // becomes:
    {this.props.bloql.posts.map(post =>
    <a href={post.meta.slug}>{post.meta.title}</a>
    )}

    for Post (to avoid polluting this.props, in case a user wants to have pass his own post prop, we shouldn't override it):

    this.props.post
    // becomes:
    this.props.bloql.post