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
Copy file name to clipboardExpand all lines: apps/site/pages/twitter-theme/api-reference.mdx
+6-6
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Fetches and renders the tweet. It accepts the following props:
16
16
- **apiUrl** - `string`: the API URL to fetch the tweet from when using the tweet client-side with SWR. Defaults to `https://react-tweet.vercel.app/api/tweet/:id`.
17
17
- **fallback** - `ReactNode`: The fallback component to render while the tweet is loading. Defaults to `TweetSkeleton`.
18
18
- **onError** - `(error?: any) => any`: The returned error will be sent to the `TweetNotFound` component.
19
-
- **components** - `TweetComponents`: Components to replace the default tweet components. See the [custom tweet components](#custom-tweet-components) section for more details.
19
+
- **components** - `TwitterComponents`: Components to replace the default tweet components. See the [custom tweet components](#custom-tweet-components) section for more details.
20
20
- **fetchOptions** - `RequestInit`: options to pass to [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch).
21
21
22
22
If the environment where `Tweet` is used does not support React Server Components then it will work with [SWR](https://swr.vercel.app/) instead and the tweet will be fetched from `https://react-tweet.vercel.app/api/tweet/:id`, which is CORS friendly.
@@ -66,7 +66,7 @@ import { EmbeddedTweet } from 'react-tweet'
66
66
Renders a tweet. It accepts the following props:
67
67
68
68
- **tweet** - `Tweet`: the tweet data, as returned by `getTweet`. Required.
69
-
- **components** - `TweetComponents`: Components to replace the default tweet components. See the [custom tweet components](#custom-tweet-components) section for more details.
69
+
- **components** - `TwitterComponents`: Components to replace the default tweet components. See the [custom tweet components](#custom-tweet-components) section for more details.
70
70
71
71
### `TweetSkeleton`
72
72
@@ -88,10 +88,10 @@ A tweet not found component. It accepts the following props:
88
88
89
89
## Custom tweet components
90
90
91
-
Default components used by [`Tweet`](#tweet) and [`EmbeddedTweet`](#embeddedtweet) can be replaced by passing a `components` prop. It extends the `TweetComponents` type exported from `react-tweet`:
91
+
Default components used by [`Tweet`](#tweet) and [`EmbeddedTweet`](#embeddedtweet) can be replaced by passing a `components` prop. It extends the `TwitterComponents` type exported from `react-tweet`:
92
92
93
93
```ts copy
94
-
type TweetComponents = {
94
+
type TwitterComponents = {
95
95
TweetNotFound?: (props:Props) =>JSX.Element
96
96
AvatarImg?: (props:AvatarImgProps) =>JSX.Element
97
97
MediaImg?: (props:MediaImgProps) =>JSX.Element
@@ -103,9 +103,9 @@ For example, to replace the default `img` tag used for the avatar and media with
103
103
```tsx copy
104
104
// tweet-components.tsx
105
105
import Image from 'next/image'
106
-
import type {TweetComponents} from 'react-tweet'
106
+
import type {TwitterComponents} from 'react-tweet'
0 commit comments