React
Notes
Immediate mode simply means you specify what to redraw on every frame, there is no caching unless you specify it. And you basically redraw whenever some state changes (in a game this is going to be at frame rate).
In React, when some state changes, you respecify the DOM for components whose state has changed, but asynchronously the library determines how to make the DOM update more efficient on the next frame redraw.
Retained-mode means you modify the scene graph (aka DOM) using imperative statements, it is difficult to keep your UI in sync with your models. With immediate-mode, you simply create a function f(m) over your model m to render it on each frame rate (which also often involves imperative instructions affecting the frame buffer, but the buffer can be cleared on each frame so who cares).
Retained-mode caches by default (often in opaque ways), which was the whole point (only re-render parts of the scene that have changed). You can roll your own caching for immediate mode, usually via some kind of invalidation scheme (use image for a node if nothing changed for this component, otherwise call that node's re-render method). On the other side, projects like React takes the retained-mode DOM and make it look more like an immediate-mode abstraction without sacrificing so much performance.
The core premise for React is that UIs are simply a projection of data into a different form of data.
Stateless components don't have
this
, just have props.Best use React in strict mode.
Links
Didact - DIY guide to build your own React.
Stop writing code - Sunil Pai (2018) - Great talk.
React from Zero - Simple (99% ES2015 less) tutorial for React.
Rogue.js - Nearly invisible framework for creating server-rendered React applications.
Evergreen - React UI Framework by Segment.
Navi - Batteries-included router for React.
Re-implement react fiber (2019) - Self-study project help understand how react work.
React-axe - Accessibility auditing for React.js applications.
Awesome React - Collection of awesome things regarding React ecosystem.
Grommet - React-based framework that provides accessibility, modularity, responsiveness, and theming in a tidy package.
Progressive react - Want to make your React site more performant? Here's a quick checklist.
Relay - JavaScript framework for building data-driven React applications.
React Fiber Architecture - Description of React's new core algorithm, React Fiber.
Router5 - Flexible and powerful universal routing solution.
Unstated Next - 200 bytes to never think about React state management libraries ever again.
Fresh Concurrent React - Fresh links about the coming concurrent react revolution.
Fusion.js - Modern framework for fast, powerful React apps.
React Live - Production-focused playground for live editing React code.
TypeScript React Cheat Sheet - List of TypeScript types generated from the declaration files for react, react-dom, react-native and other libraries.
Divjoy - React codebase generator.
zustand - Small, fast and scaleable bearbones state-management solution.
Relay - JavaScript framework for building data-driven React applications.
Reatom - Declarative and reactive state manager, designed for both simple and complex applications.
Minimal Images from Unsplash - Project was bootstrapped with Create React App.
CodeLift - "No Code" GUI for your existing React code.
suspense-cache - Cache utility to create resources for React suspense.
Proton Native - React environment for cross platform desktop apps.
Jira Clone in React - Simplified Jira clone built with React/Babel (Client), and Node/TypeScript (API). Auto formatted with Prettier, tested with Cypress. (HN)
iPod.js - iPod Classic built using React Hooks, TypeScript, & GraphQL.
Undux - Simple & typesafe alternative to Flux and Redux.
React Diff Viewer - Simple and beautiful text diff viewer made with Diff and React. (Code)
React in patterns - Free book that talks about design patterns/techniques used while developing with React. (Code)
Vidact - Compiler that converts React-compatible codes to VanillaJS with no Virtual DOM.
Under the hood: React - Entire React code base explanation by visual block schemes (Stack version). (Code)
Last updated
Was this helpful?