2021-05-24
3517
#react
Sebastian Weber
50000
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:

A Guide To Javascript Parser Generators

A guide to JavaScript parser generators

Explore three JavaScript parser generator libraries and the benefits of creating custom parsers for specific project needs.

Yashodhan Joshi
May 30, 2024 ⋅ 16 min read
Using Rust And Axum To Build A Jwt Authentication Api

Using Rust and Axum to build a JWT authentication API

Learn to build a basic JWT authentication system with Rust and Axum, including setting up the routes, handlers, and the middleware system.

Eze Sunday
May 29, 2024 ⋅ 9 min read
Building A Customizable Dashboard With Dashy

Building a customizable dashboard with Dashy

Dashy helps us create beautiful, customizable, modern dashboard pages with web service links and widgets.

Shalitha Suranga
May 29, 2024 ⋅ 10 min read
Winterjs Vs Bun: Comparing Javascript Runtimes

WinterJS vs. Bun: Comparing JavaScript runtimes

WinterJS is theoretically the fastest WinterCG JavaScript runtime. Let’s compare WinterJS to Bun, another runtime known for its speed.

Emmanuel Odioko
May 28, 2024 ⋅ 6 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” || “”}`
    or
    `App ${darkMode ? “dark-mode” : “”}`
    to generate “App ” as the class when dark mode is disabled.

Leave a Reply