中继现代碎片容器,道具不会自动可用
Relay Modern Fragment Container, props not available automatically
文档指出:https://facebook.github.io/relay/docs/en/fragment-container.html#arguments
A graphql tagged fragment. If the fragment uses the name convention
<...>_, the fragment's data will be available to
the Component as a prop with the given . If the fragment
name doesn't specify a prop name, the data will be available as a data
prop.
但是数据似乎没有作为 .data 道具传递给我的反应组件。我必须使用道具手动传递它。
数据已获取并在中继存储中。但是,组件不知道如何获取此数据,除非父级将匹配的有效负载传递给它。
不建议这样做,但如果您在组件上使用 mask
pragma / 指令进行试验,它会让您了解各个部分如何组合在一起。
文档指出:https://facebook.github.io/relay/docs/en/fragment-container.html#arguments
A graphql tagged fragment. If the fragment uses the name convention <...>_, the fragment's data will be available to the Component as a prop with the given . If the fragment name doesn't specify a prop name, the data will be available as a data prop.
但是数据似乎没有作为 .data 道具传递给我的反应组件。我必须使用道具手动传递它。
数据已获取并在中继存储中。但是,组件不知道如何获取此数据,除非父级将匹配的有效负载传递给它。
不建议这样做,但如果您在组件上使用 mask
pragma / 指令进行试验,它会让您了解各个部分如何组合在一起。