【发布时间】:2021-03-16 07:18:16
【问题描述】:
Gatsby/Contentful Starter 代码示例:
import get from 'lodash/get'
...
const post = get(this.props, 'data.contentfulBlogPost')
const siteTitle = get(this.props, 'data.site.siteMetadata.title')
为什么他们在html代码中使用lodash'get'而不是直接引用graphql-query结果'data'?
【问题讨论】:
标签: reactjs graphql lodash gatsby contentful