Sebastian Weber
May 24, 2021 ⋅ 12 min read

useState vs. useRef: Similarities, differences, and use cases

Sebastian Weber Fell in love with CSS and JS over 20 years ago.

Recent posts:

Mastering Modulo Operator JavaScript

Mastering the modulo operator in JavaScript: A complete guide

We investigate how the modulo operator works in JavaScript and explore several real-life applications, like cyclic patterns and animations.

Timonwa Akintokun
Dec 8, 2023 ⋅ 7 min read
Ken Pickering Leader Spotlight

Leader Spotlight: Building with grit with Ken Pickering

Ken Pickering discusses the challenges associated with uncertainty and shares insights on scaling data structures and engineering teams.

Jessica Srinivas
Dec 8, 2023 ⋅ 7 min read
Understanding Solid Js Props A Complete Guide From Beginner To Advanced

Understanding SolidJS props: A complete guide

Let’s see how Solid props work to promote component reusability, exploring basic to advanced concepts for a complete understanding.

Temitope Oyedele
Dec 7, 2023 ⋅ 11 min read
Eleventy Vs. Next.js Static-Site Generation

Eleventy vs. Next.js for static site generation

We evaluate Eleventy and Next.js and compare both static site generators in terms of performance, developer experience, scalability, and ecosystem.

Nelson Michael
Dec 7, 2023 ⋅ 11 min read
View all posts

One Reply to "<code>useState</code> vs. <code>useRef</code>: Similarities, differences, and use cases"

  1. Don’t use:
    `App ${darkMode && “dark-mode”}`
    As it will result with an “App false” class, if dark mode is disabled.

    Instead, use:
    `App ${darkMode && “dark-mode” || “”}`
    `App ${darkMode ? “dark-mode” : “”}`
    to generate “App ” as the class when dark mode is disabled.

Leave a Reply