惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

I
InfoQ
博客园_首页
美团技术团队
M
MIT News - Artificial intelligence
人人都是产品经理
人人都是产品经理
Blog — PlanetScale
Blog — PlanetScale
H
Help Net Security
J
Java Code Geeks
T
Tailwind CSS Blog
Jina AI
Jina AI
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
爱范儿
爱范儿
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
宝玉的分享
宝玉的分享
小众软件
小众软件
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Visual Studio Blog
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

Vercel News

Vercel Open Source Program: Winter 2026 cohort How Notion Workers run untrusted code at scale with Vercel Sandbox How we run Vercel's CDN in front of Discourse From idea to secure checkout in minutes with Stripe Building Slack agents can be easy Scaling redirects to infinity on Vercel Advancing Python typing Gamma builds design-first agents with Vercel How Avalara turns pipe dreams into patent-pending with v0 Keeping community human while scaling with agents How OpenEvidence built a healthcare AI that physicians actually trust Security boundaries in agentic architectures Skills Night: 69,000+ ways agents are getting smarter Video Generation with AI Gateway We Ralph Wiggumed WebStreams to make them 10x faster How Stably ships AI testing agents in hours, not weeks How we built AEO tracking for coding agents Anyone can build agents, but it takes a platform to run them Introducing Geist Pixel The Vercel AI Accelerator is back with $6m in credits Making agent-friendly pages with content negotiation The Vercel OSS Bug Bounty program is now available Introducing the new v0 Run untrusted code with Vercel Sandbox, now generally available How Stripe built a game-changing app in a single flight with v0 How Sensay went from zero to product in six weeks AGENTS.md outperforms skills in our agent evals Agent skills explained: An FAQ Testing if "bash is all you need" AWS databases are now live on the Vercel Marketplace and v0
Introducing React Tweet - Vercel – Vercel
2023-07-25 · via Vercel News

2 min read

Embed tweets into your React application without sacrificing performance.

Introducing react-tweet – embed tweets into any React application with a single line of code, without sacrificing performance.

app/page.tsx

import { Tweet } from 'react-tweet'

export default function Page() {

return <Tweet id="1683920951807971329" />

}

The resulting tweet – statically generated, no iframes required:

Some benefits of using react-tweet:

  • 35x less client-side JavaScript than the Twitter's Native embed

  • Support for React Server Components

  • Built-in data fetching and caching

  • Works with any React framework – Next.js, Vite, and Create React App

Link to headingImproving embeds with Server Components

Historically, embedding tweets has required using Twitter's embedded iframe. This loads 560kb worth of client-side JavaScript, which slows site performance and causes layout shift.

With react-tweet, you no longer need to use iframes. Instead, all you need is a simple React component that is compatible with Next.js, Vite, and Create React App:

app/page.tsx

import { Tweet } from 'react-tweet'

export default function Page() {

return <Tweet id="1683920951807971329" />

}

The resulting embedded tweet has several advantages:

  • No layout shift or scrolling jumps (Cumulative Layout Shift)

  • Improved UX with instantly visible tweets in the browser (no lazy loading)

  • Build with the powerful React component abstraction.

To demonstrate this performance improvement, here's a comparison between the native Twitter embed, iframe embed, and react-tweet:

Link to headingNative Twitter embed

Link to headingTwitter embed with iframe

Link to headingreact-tweet

Link to headingHow react-tweet works

Under the hood, react-tweet reverse-engineers the Twitter's Embed API to fetch data for a given tweet and renders it in the same style as Twitter's embedded iframe.

You don't need to rely on Twitter API v2 to fetch tweets on your own, saving you money and making it easier to add tweets to your site.

Link to headingGet started with react-tweet

Try out react-tweet today by running the following command:

npm i react-tweet

Check out the documentation to learn more.