In a previous article, I wanted to embed a Twitter/X post.
The raw embed code is a bit messy and doesn't look great on a dark theme.
Luckily, there's a handy package called react-tweet that works great.
Just install it and import it into your MDX file:
It's that easy. It also supports prefers-color-scheme
out of the box – so looks great on both light and dark themes.
Liked this article? Share it on X