BeFreed
    Categories>Technology>Mastering Minimal State: The Golden Rule of React

    Mastering Minimal State: The Golden Rule of React

    21 min
    |
    |
    8 мар. 2026 г.
    TechnologyEducationProductivity

    Stop the 'Two Renders' trap by learning why derived data belongs in variables, not state. Using the filtered episodes example, we reveal how to streamline performance and simplify your React architecture.

    Mastering Minimal State: The Golden Rule of React

    Лучшая цитата из Mastering Minimal State: The Golden Rule of React

    “

    The Golden Rule is simple: if you can calculate a value from existing state or props, do not store it in state. Your component is basically a mini-database where the state is your raw data and everything else is just a view of that data.

    ”

    Этот аудиоурок был создан участником сообщества BeFreed

    Вопрос для ввода

    Teach why you should not store calculated values in state. Use filteredEpisodes example. Give rule: if you can calculate it from existing state, don’t store it.

    Голоса ведущих
    Lenaplay
    Jacksonplay
    Стиль обучения
    Весёлый
    Источники знаний
    Developing Backbone.js Applications
    Two Scoops of Django
    Clean Code
    Refactoring
    Software Engineering at Google
    Designing Data-Intensive Applications

    Часто задаваемые вопросы

    The "Two Renders" problem occurs when a developer uses an effect to update a second state variable based on a change in the first. For example, if a user types in a search box, React performs the first render to update the search query state. Only after that render is committed does the useEffect fire to filter the list and call a second state setter, which immediately triggers a second render. This process can cause a visible flash of incorrect data and doubles the workload for the browser's layout engine, leading to a "sticky" or laggy UI.

    The Golden Rule is that if a value can be calculated from existing state or props, you should not store it in a new state variable. Instead of using useState and useEffect to sync derived data, you should calculate the value directly within the component body during the render phase using a simple JavaScript constant. This ensures that the UI always stays in sync with the source of truth and avoids the overhead of unnecessary lifecycle management.

    While most calculations like filtering or mapping a few thousand items are fast enough to happen during every render, useMemo should be used as a performance hint for truly expensive transformations. It allows React to cache the result of a calculation and only re-run it when specific dependencies change. However, the script emphasizes that useMemo is not for storing state; it is a tool to skip unnecessary work. Developers should start with a plain calculation and only add useMemo if the UI feels measurably laggy.

    The "Props-to-State Copy" error happens when a child component initializes internal state from a prop but fails to update when that prop changes. Rather than using a useEffect to manually sync the prop to the state, a cleaner architectural move is to use a key prop on the component. When the value of the key (such as a user ID) changes, React will discard the old component instance and its stale state, creating a fresh version of the component with the new prop values initialized correctly.

    The primary job of useEffect is to synchronize the component with external systems that live outside of React's render cycle. This includes tasks like making network requests to an API, interacting with localStorage, setting up timers, or manual DOM manipulations. If the logic is internal to the app—such as sorting a list, validating a form, or calculating a total—it is a calculation that belongs in the render path, not in an effect.

    Узнать больше

    deep react knowledge

    deep react knowledge

    ПЛАН ОБУЧЕНИЯ

    deep react knowledge

    React continues to dominate the frontend development landscape, but mastering its core concepts and advanced patterns is essential for building professional-grade applications. This learning plan is ideal for developers who have basic JavaScript knowledge and want to become proficient React engineers capable of building complex, performant applications.

    2 h 22 m•3 Разделы
    Master Go, React, and JavaScript Development

    Master Go, React, and JavaScript Development

    ПЛАН ОБУЧЕНИЯ

    Master Go, React, and JavaScript Development

    This plan is essential for developers aiming to bridge the gap between frontend and backend mastery using modern frameworks. It is ideal for aspiring full-stack engineers who want to build scalable, high-performance applications with Go and React.

    4 h 5 m•4 Разделы
    I want to learn how to write react front end

    I want to learn how to write react front end

    ПЛАН ОБУЧЕНИЯ

    I want to learn how to write react front end

    React continues to be the most popular JavaScript library for building user interfaces, powering millions of web applications. This learning plan takes you from React fundamentals to advanced architecture patterns, ideal for developers looking to build modern, performant front-end applications.

    3 h 42 m•4 Разделы
    Master CS, DSA & Reduce AI Reliance

    Master CS, DSA & Reduce AI Reliance

    ПЛАН ОБУЧЕНИЯ

    Master CS, DSA & Reduce AI Reliance

    In an era of AI-driven development, deep foundational knowledge is what separates elite engineers from the rest. This plan is designed for developers who want to reclaim their technical independence by mastering the underlying principles of systems and algorithms.

    3 h 8 m•4 Разделы
    js read

    js read

    ПЛАН ОБУЧЕНИЯ

    js read

    This plan bridges the gap between basic coding and professional web development. It is ideal for aspiring developers looking to master modern JavaScript, from UI interactivity to scalable application architecture.

    2 h 14 m•4 Разделы
    Improve the user experience of the app.

    Improve the user experience of the app.

    ПЛАН ОБУЧЕНИЯ

    Improve the user experience of the app.

    This learning plan is essential for product managers and designers looking to bridge the gap between aesthetics and functional business results. It provides a comprehensive roadmap for anyone wanting to master the psychological and data-driven aspects of modern app design.

    2 h 38 m•4 Разделы
    Master Routine, Home, Work & Communication

    Master Routine, Home, Work & Communication

    ПЛАН ОБУЧЕНИЯ

    Master Routine, Home, Work & Communication

    In an era of constant distraction, mastering the systems that govern our daily lives is essential for long-term success. This plan is ideal for professionals and individuals seeking to harmonize their domestic organization with workplace efficiency and interpersonal clarity.

    2 h 28 m•4 Разделы
    Finish game projects with discipline & focus

    Finish game projects with discipline & focus

    ПЛАН ОБУЧЕНИЯ

    Finish game projects with discipline & focus

    This learning plan addresses the critical gap between having creative game ideas and actually bringing them to completion. It's designed for aspiring game designers and developers who struggle with project consistency, frequently abandon projects midway, or find their creative ambitions undermined by poor habits and energy management. By combining game design mastery with productivity systems and sustainable health practices, this plan equips you to not just understand what makes great games, but to develop the discipline and stamina to actually create them.

    2 h 12 m•4 Разделы

    Создано выпускниками Колумбийского университета в Сан-Франциско

    BeFreed объединяет глобальное сообщество из 1,000,000 любознательных умов
    Узнайте больше о том, как обсуждают BeFreed в интернете

    "Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

    @Moemenn
    platform
    star
    star
    star
    star
    star

    "I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

    @Chloe, Solo founder, LA
    platform
    comments
    12
    likes
    117

    "Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

    @Raaaaaachelw
    platform
    star
    star
    star
    star
    star

    "Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

    @Matt, YC alum
    platform
    comments
    12
    likes
    108

    "Reading used to feel like a chore. Now it’s just part of my lifestyle."

    @Erin, Investment Banking Associate , NYC
    platform
    comments
    254
    likes
    17

    "Feels effortless compared to reading. I’ve finished 6 books this month already."

    @djmikemoore
    platform
    star
    star
    star
    star
    star

    "BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

    @Pitiful
    platform
    comments
    96
    likes
    4.5K

    "BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

    @SofiaP
    platform
    star
    star
    star
    star
    star

    "BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

    @Jaded_Falcon
    platform
    comments
    201
    thumbsUp
    16

    "It is great for me to learn something from the book without reading it."

    @OojasSalunke
    platform
    star
    star
    star
    star
    star

    "The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

    @Leo, Law Student, UPenn
    platform
    comments
    37
    likes
    483

    "Makes me feel smarter every time before going to work"

    @Cashflowbubu
    platform
    star
    star
    star
    star
    star

    Создано выпускниками Колумбийского университета в Сан-Франциско

    BeFreed объединяет глобальное сообщество из 1,000,000 любознательных умов
    Узнайте больше о том, как обсуждают BeFreed в интернете

    "Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

    @Moemenn
    platform
    star
    star
    star
    star
    star

    "I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

    @Chloe, Solo founder, LA
    platform
    comments
    12
    likes
    117

    "Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

    @Raaaaaachelw
    platform
    star
    star
    star
    star
    star

    "Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

    @Matt, YC alum
    platform
    comments
    12
    likes
    108

    "Reading used to feel like a chore. Now it’s just part of my lifestyle."

    @Erin, Investment Banking Associate , NYC
    platform
    comments
    254
    likes
    17

    "Feels effortless compared to reading. I’ve finished 6 books this month already."

    @djmikemoore
    platform
    star
    star
    star
    star
    star

    "BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

    @Pitiful
    platform
    comments
    96
    likes
    4.5K

    "BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

    @SofiaP
    platform
    star
    star
    star
    star
    star

    "BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

    @Jaded_Falcon
    platform
    comments
    201
    thumbsUp
    16

    "It is great for me to learn something from the book without reading it."

    @OojasSalunke
    platform
    star
    star
    star
    star
    star

    "The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

    @Leo, Law Student, UPenn
    platform
    comments
    37
    likes
    483

    "Makes me feel smarter every time before going to work"

    @Cashflowbubu
    platform
    star
    star
    star
    star
    star

    "Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

    @Moemenn
    platform
    star
    star
    star
    star
    star

    "I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

    @Chloe, Solo founder, LA
    platform
    comments
    12
    likes
    117

    "Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

    @Raaaaaachelw
    platform
    star
    star
    star
    star
    star

    "Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

    @Matt, YC alum
    platform
    comments
    12
    likes
    108

    "Reading used to feel like a chore. Now it’s just part of my lifestyle."

    @Erin, Investment Banking Associate , NYC
    platform
    comments
    254
    likes
    17

    "Feels effortless compared to reading. I’ve finished 6 books this month already."

    @djmikemoore
    platform
    star
    star
    star
    star
    star

    "BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

    @Pitiful
    platform
    comments
    96
    likes
    4.5K

    "BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

    @SofiaP
    platform
    star
    star
    star
    star
    star

    "BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

    @Jaded_Falcon
    platform
    comments
    201
    thumbsUp
    16

    "It is great for me to learn something from the book without reading it."

    @OojasSalunke
    platform
    star
    star
    star
    star
    star

    "The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

    @Leo, Law Student, UPenn
    platform
    comments
    37
    likes
    483

    "Makes me feel smarter every time before going to work"

    @Cashflowbubu
    platform
    star
    star
    star
    star
    star

    "Instead of endless scrolling, I just hit play on BeFreed. It saves me so much time."

    @Moemenn
    platform
    star
    star
    star
    star
    star

    "I never knew where to start with nonfiction—BeFreed’s book lists turned into podcasts gave me a clear path."

    @Chloe, Solo founder, LA
    platform
    comments
    12
    likes
    117

    "Perfect balance between learning and entertainment. Finished ‘Thinking, Fast and Slow’ on my commute this week."

    @Raaaaaachelw
    platform
    star
    star
    star
    star
    star

    "Crazy how much I learned while walking the dog. BeFreed = small habits → big gains."

    @Matt, YC alum
    platform
    comments
    12
    likes
    108

    "Reading used to feel like a chore. Now it’s just part of my lifestyle."

    @Erin, Investment Banking Associate , NYC
    platform
    comments
    254
    likes
    17

    "Feels effortless compared to reading. I’ve finished 6 books this month already."

    @djmikemoore
    platform
    star
    star
    star
    star
    star

    "BeFreed turned my guilty doomscrolling into something that feels productive and inspiring."

    @Pitiful
    platform
    comments
    96
    likes
    4.5K

    "BeFreed turned my commute into learning time. 20-min podcasts are perfect for finishing books I never had time for."

    @SofiaP
    platform
    star
    star
    star
    star
    star

    "BeFreed replaced my podcast queue. Imagine Spotify for books — that’s it. 🙌"

    @Jaded_Falcon
    platform
    comments
    201
    thumbsUp
    16

    "It is great for me to learn something from the book without reading it."

    @OojasSalunke
    platform
    star
    star
    star
    star
    star

    "The themed book list podcasts help me connect ideas across authors—like a guided audio journey."

    @Leo, Law Student, UPenn
    platform
    comments
    37
    likes
    483

    "Makes me feel smarter every time before going to work"

    @Cashflowbubu
    platform
    star
    star
    star
    star
    star
    1.5K Ratings4.7
    Начните своё обучение прямо сейчас
    BeFreed App
    BeFreed

    Учите что угодно персонализированно

    DiscordLinkedIn
    Избранные книги
    Crucial ConversationsThe Perfect MarriageInto the WildNever Split the DifferenceAttachedGood to GreatSay Nothing
    Популярные категории
    Self HelpCommunication SkillRelationshipMindfulnessPhilosophyInspirationProductivity
    Списки чтения знаменитостей
    Elon MuskCharlie KirkBill GatesSteve JobsAndrew HubermanJoe RoganJordan Peterson
    Коллекция наград
    Pulitzer PrizeNational Book AwardGoodreads Choice AwardsNobel Prize in LiteratureNew York TimesCaldecott MedalNebula Award
    Избранные темы
    ManagementAmerican HistoryWarTradingStoicismAnxietySex
    Лучшие книги по годам
    2025 Best Non Fiction Books2024 Best Non Fiction Books2023 Best Non Fiction Books
    Избранные авторы
    Chimamanda Ngozi AdichieGeorge OrwellO. J. SimpsonBarbara O'NeillWinston ChurchillCharlie Kirk
    BeFreed vs другие приложения
    BeFreed vs. Other Book Summary AppsBeFreed vs. ElevenReaderBeFreed vs. ReadwiseBeFreed vs. Anki
    Инструменты обучения
    Knowledge VisualizerAI Podcast Generator
    Информация
    О насarrow
    Ценыarrow
    Частые вопросыarrow
    Блогarrow
    Карьераarrow
    Партнёрствоarrow
    Программа амбассадоровarrow
    Каталогarrow
    BeFreed
    Try now
    © 2026 BeFreed
    Условия использованияПолитика конфиденциальности
    BeFreed

    Учите что угодно персонализированно

    DiscordLinkedIn
    Избранные книги
    Crucial ConversationsThe Perfect MarriageInto the WildNever Split the DifferenceAttachedGood to GreatSay Nothing
    Популярные категории
    Self HelpCommunication SkillRelationshipMindfulnessPhilosophyInspirationProductivity
    Списки чтения знаменитостей
    Elon MuskCharlie KirkBill GatesSteve JobsAndrew HubermanJoe RoganJordan Peterson
    Коллекция наград
    Pulitzer PrizeNational Book AwardGoodreads Choice AwardsNobel Prize in LiteratureNew York TimesCaldecott MedalNebula Award
    Избранные темы
    ManagementAmerican HistoryWarTradingStoicismAnxietySex
    Лучшие книги по годам
    2025 Best Non Fiction Books2024 Best Non Fiction Books2023 Best Non Fiction Books
    Инструменты обучения
    Knowledge VisualizerAI Podcast Generator
    Избранные авторы
    Chimamanda Ngozi AdichieGeorge OrwellO. J. SimpsonBarbara O'NeillWinston ChurchillCharlie Kirk
    BeFreed vs другие приложения
    BeFreed vs. Other Book Summary AppsBeFreed vs. ElevenReaderBeFreed vs. ReadwiseBeFreed vs. Anki
    Информация
    О насarrow
    Ценыarrow
    Частые вопросыarrow
    Блогarrow
    Карьераarrow
    Партнёрствоarrow
    Программа амбассадоровarrow
    Каталогarrow
    BeFreed
    Try now
    © 2026 BeFreed
    Условия использованияПолитика конфиденциальности

    Ключевые выводы

    1

    The State Management Golden Rule

    0:00
    0:13
    0:30
    0:37
    2

    The Two Renders Performance Trap

    0:50
    1:23
    1:32
    2:01
    2:06
    2:31
    2:39
    2:58
    3:04
    3:27
    3:31
    3

    Thinking Like a Database Architect

    3:48
    4:10
    0:30
    4:37
    4:53
    5:19
    5:29
    5:48
    5:55
    6:21
    6:25
    6:48
    2:06
    4

    Spotting Red Flags in Your Code

    7:07
    7:29
    7:48
    7:54
    8:13
    8:23
    8:50
    8:57
    9:17
    2:06
    9:47
    9:56
    5

    The Architecture of Minimal State

    10:12
    10:32
    10:43
    11:00
    8:57
    11:31
    11:42
    12:02
    12:12
    12:31
    2:06
    12:53
    13:07
    6

    When You Actually Need an Effect

    13:15
    13:28
    13:36
    13:54
    14:02
    14:21
    14:29
    14:49
    3:31
    15:14
    15:23
    15:38
    8:57
    7

    A Practical Playbook for Clean State

    15:57
    16:13
    2:06
    16:39
    8:23
    17:10
    17:15
    17:30
    17:38
    17:54
    18:01
    18:12
    18:20
    8

    Final Reflections on the Render Cycle

    18:29
    18:45
    18:59
    19:14
    15:23
    19:35
    19:46
    19:57
    20:06
    20:15
    20:21
    0:37
    20:43
    20:52

    Похожий контент

    Обложка книги Mastering React: Lifting State Up for Component Coordination
    Developing Backbone.js ApplicationsKubernetes PatternsBuilding MicroservicesThe Book You Wish Your Parents Had Read (and Your Children Will Be Glad That You Did)
    23 sources
    Mastering React: Lifting State Up for Component Coordination
    Learn how to sync isolated components like an EpisodeList and PlayerBar by moving state to a shared parent, ensuring a single source of truth.
    22 min
    Обложка книги React State Mistakes: Stop Storing Derived Data
    Developing Backbone.js ApplicationsTwo Scoops of DjangoRefactoringClean Code
    25 sources
    React State Mistakes: Stop Storing Derived Data
    Managing filtered lists in state often leads to bugs and extra renders. Learn why calculating values on the fly keeps your UI in sync and your code clean.
    22 min
    Обложка книги From Chaos to Control: Mastering React's useReducer
    Developing Backbone.js ApplicationsRefactoring: Improving the Design of Existing CodeKubernetes PatternsHands-On Machine Learning with Scikit-Learn and TensorFlow
    23 sources
    From Chaos to Control: Mastering React's useReducer
    Stop juggling messy useState calls and learn to centralize complex logic. Using an audio player example, we explore how useReducer provides a scalable, predictable blueprint for managing sophisticated state transitions.
    24 min
    Обложка книги Mastering useCallback: Solving the Mystery of Wasted Renders
    Refactoring: Improving the Design of Existing CodeClean CodeHow to Pass ExamsDeveloping Backbone.js Applications
    22 sources
    Mastering useCallback: Solving the Mystery of Wasted Renders
    Learn why stable function identity is the key to React performance. We use the EpisodeCard example to show how useCallback prevents unnecessary re-renders by caching event handlers.
    22 min
    Обложка книги Mastering Controlled Inputs in React
    Developing Backbone.js ApplicationsClean CodeDependency Injection in .NETTwo Scoops of Django
    26 sources
    Mastering Controlled Inputs in React
    Learn to harness the state-to-value loop by transforming a standard search bar into a predictable, state-driven component that gives you total authority over every keystroke.
    22 min
    Обложка книги Mastering React Props: The Blueprint for Dynamic Components
    Developing Backbone.js ApplicationsA Philosophy of Software Design, 2nd EditionClean ArchitectureAlgorithms + Data Structures  eq  Programs
    26 sources
    Mastering React Props: The Blueprint for Dynamic Components
    Discover how to build reusable UI using props to pass data from parents to children. Learn why one-way data flow and immutability are the secrets to predictable React applications.
    22 min
    Обложка книги Simple Rules
    Simple Rules
    Donald Sull & Kathleen M. Eisenhardt
    A guide to crafting streamlined strategies for decision-making in complex environments, using insights from diverse fields and industries.
    10 min
    Обложка книги Refactoring
    Refactoring
    Martin Fowler
    Transform code safely with small, behavior-preserving steps.
    9 min