{user.login}
-{detail.name}
-{detail.company}
-{detail.location}
- {/await} -{user.login}
-` tag for now. Then export that function: - -```tsx -// src/components/UserDisplay.tsx - -function UserDisplay() { - return
User Component
-} - -export default UserDisplay -``` -This will serve as the skeleton for your component. The goal here is to allow this component to take in a `user` parameter and display that user's data inside of the component. - -To accomplish this, first import your `User` type at the very top of `src/components/UserDisplay.tsx`: - -```tsx -// src/components/UserDisplay.tsx - -import { User } from '../types' - -// ... -``` -You will use this type to describe what a `user` property in your `UserDisplay` function should contain. - -Add a new `type` to this file named `Props` with a single `user` field of the `User` type. Use that type to describe your function's arguments _(or "props")_: - -```tsx -// src/components/UserDisplay.tsx - -import { User } from '../types' - -type Props = { - user: User -} - -function UserDisplay({ user }: Props) { - returnUser Component
-} - -export default UserDisplay -``` -> **Note**: The `user` key is being [destructured](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment) within the function arguments to allow easy access to its values. - -The `user` property allows you to provide your component an object of type `User`. Each user in this application will be displayed within a rectangle that contains the user's name. - -Replace the existing `` tag with the following JSX to display a user's name with some nice TailwindCSS styles: - -```tsx -// src/components/UserDisplay.tsx - -// ... -function UserDisplay({ user }: Props) { - return
- {user.name} -
-- {message.body} -
-- {user.name} -
-- {message.body} -
-{{ product.name }}
-{{ product.description }}
-{{ product.price | currency }}
- -Loading...
- if (error) returnOh no... {error.message}
- - return ( -{link.category}
-{link.title}
-{link.description}
- - {link.url.replace(/(^\w+:|^)\/\//, '')} - - -Loading...
; - if (error) returnOh no... {error.message}
; - - const { endCursor, hasNextPage } = data.links.pageInfo; - - return ( -- You've reached the end!{" "} -
- )} -The child
-` tag is a child of the `Parent` component and will be rendered into the `Parent` component wherever you decide to render the `children` prop value. -