all AI news
Jotai Tips
DEV Community dev.to
Learn Jotai with handy tips!
Introduction
I've been sharing tips about Jotai on Twitter, calling them "Jotai tips." As tweets tend to get lost over time, I thought it would be good to have all these tips in one place.
So, here we go.
Tip 1: Primitive-like atoms
// Detect dark theme
var iframe = document.getElementById('tweet-1694494217379459573-419');
if (document.body.className.includes('dark-theme')) {
iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1694494217379459573&theme=dark"
}
Tip 2: Early return
// Detect dark theme
var iframe = document.getElementById('tweet-1694876971367555217-269');
if (document.body.className.includes('dark-theme')) {
iframe.src = …
document good introduction javascript jotai learn lost react them thought tips tweet tweets twitter