You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing fields into components by spreading shows them as unused by the relay/unused-fields, while passing them one by one does not cause any issues.
typeProps={data: ParentComponent_data;};constParentComponent: FC<Props>=({ data })=>{const{ title, ...rest}=data;return<SharedComponenttitle={title}{...rest}/>;
}exportdefaultcreateFragmentContainer(ParentComponent,{data: graphql` fragment ParentComponent_data on Data { name # <- Triggers a warning about not being used! title } `,});
The text was updated successfully, but these errors were encountered:
it does not track how a piece of data are passed down to the child components and figure out if subfields are used in that child component.
Also there's a 2nd issue of this naive implementation, it can produce false positives because it's only checking the name of the properties, regardless of from which object it's being accessed, so the following is actually invalid case (foo.bar unsued) but test still passes:
graphql\`fragment foo on Foo {
bar
baz {
bar
}
}\`;
foo.baz.bar;
Passing fields into components by spreading shows them as unused by the
relay/unused-fields
, while passing them one by one does not cause any issues.The text was updated successfully, but these errors were encountered: