ReactJS Hook Pattern ~Deriving State~

Published: (January 19, 2026 at 11:14 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

Cover image for ReactJS Hook Pattern Deriving State

Avoid Redundant State

Pattern: Avoid storing a state that can be calculated from existing other states. In ReactJS, this pattern is officially recommended as Avoid redundant state.

import { useState } from "react";

function App() {
  const [firstName] = useState("John");
  const [lastName] = useState("Doe");

  const fullName = `${firstName} ${lastName}`;

  return (
    <>
      Full Name: {fullName}
    </>
  );
}

export default App;
Back to Blog

Related posts

Read more »

Python Closures: Coming from JavaScript

Learning with Books vs. Videos > “Books – Gain depth of knowledge on a topic > Videos – Quickly ramp up to use a specific technology” I still reach for a book...

Build Quincy's Job Tips Page

Introduction This morning I tackled the next workshop in the Responsive Web Design certification on freeCodeCamp: building a job tips page. The workshop provid...