useFragment props.user vs data
- Dominant language
- Rust
- Stars
- 19k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I'm confused by how I am supposed to handle `data` vs `user`? For example, in the `useFragment` example in the docs
```
import type {UserComponent_user$key} from 'UserComponent_user.graphql';
const React = require('React');
const {graphql, useFragment} = require('react-relay/hooks');
type Props = {|
user: UserComponent_user$key, // **Why declare this if I can't even use the user variable?**
|};
function UserComponent({user}: Props) {
// **What if I want to call this user???**
const data = useFragment(
graphql`
fragment UserComponent_user on User {
name
profile_picture(scale: 2) {
uri
}
}
`,
user, // **what does this do?**
);
return (
<>
{data.name}
);
}
```
Contributor guide
Assessment
This issue has not been assessed yet.