Latest Ext JS 8.1 is now available – Download now!

High-Frequency Updates in a React Grid Without Freezing the UI

Dec 4, 2026 105 Views

Get a summary of this article:

Trading screens, logistics consoles, IoT monitors and operations dashboards all share one problem: the data changes faster than people can read it. A market feed can send thousands of price ticks a second. If a react data grid tries to apply every one of those high-frequency updates the moment it arrives, the browser spends all its time re-rendering, scrolling stutters, clicks lag and the tab can freeze entirely.

The fix isn’t a faster grid on its own. It’s a different update pipeline: collect updates as they arrive, keep only the latest value per row, and apply them to the grid in small batches at a rate humans can actually see. This guide walks through that pipeline step by step, with working code for a live price grid built on the Ext JS grid in React through ReExt.

High-Frequency Updates in a React Grid Without Freezing the UI

Why grids freeze under high-frequency updates

Three things go wrong when every update is applied immediately:

Problem What happens Effect on users
Too many renders Each update triggers its own repaint, often hundreds or thousands per second Scrolling stutters; clicks and typing lag
Wasted work A row that changes 20 times in a second is redrawn 20 times, though users can only see the last value The main thread is busy with updates nobody sees
Re-sorting and re-filtering If the grid is sorted or filtered by a changing column, every update can reorder rows Rows jump around and selections move unpredictably

In React, there’s a fourth trap: putting the live data in React state. Every tick then re-renders the component tree that owns the grid. For high-frequency data, the updates should bypass React rendering entirely and go straight to the grid’s data store.

Five techniques that keep the UI responsive

A responsive real-time grid combines five techniques. Each removes a different kind of wasted work:

  1. Buffer incoming updates. Don’t touch the grid when a message arrives. Put it in a buffer instead.
  2. Coalesce by row. Keep only the latest update for each row. If a symbol changes 20 times between flushes, the grid sees one change.
  3. Flush on a schedule. Apply the buffer to the grid at a fixed interval, typically every 100 to 500 milliseconds. People can’t read faster than that anyway.
  4. Apply each batch in one pass. Suspend the grid’s change notifications while a batch is applied, then resume them once, so the grid refreshes once per batch rather than once per row.
  5. Render only what’s visible. Buffered rendering means changes to rows outside the viewport cost almost nothing to display.

Together, these change the grid’s workload from “thousands of updates per second” to “a few refreshes per second, each touching only changed rows.” The flow looks like this:


    WebSocket messages ──▶ buffer (latest per row) ──▶ flush every 250 ms ──▶ store batch update ──▶ grid refreshes visible rows
       thousands/sec            coalesced                  4 times/sec                one pass                  once per flush

Step 1: Buffer and coalesce updates

The buffer is a small, framework-free module. Incoming updates go into a Map keyed by row ID, so a newer update for the same row simply replaces the older one. A timer hands the collected batch to a flush function at a fixed interval:


    // src/live/tickBuffer.ts
    export interface Tick {
      symbol: string;   // row ID
      price: number;
      volume: number;
    }

    export function createTickBuffer(flush: (ticks: Tick[]) => void, intervalMs = 250) {
      let pending = new Map<string, Tick>();

      const timer = setInterval(() => {
        if (!pending.size) return;
        const batch = [...pending.values()];
        pending = new Map();
        flush(batch);
      }, intervalMs);

      return {
        push: (tick: Tick) => { pending.set(tick.symbol, tick); },   // latest value wins
        stop: () => clearInterval(timer),
      };
    }

Two details matter:

  • The buffer never touches the UI. Receiving a message costs one Map.set, so even thousands of messages a second barely register on the main thread.
  • Coalescing is automatic. Because the map is keyed by symbol, intermediate prices are dropped. Users only ever see the latest value, which is what they’d see anyway.

In a test with a mock feed sending about 5,000 ticks a second across 2,000 symbols, this buffer turned 10,250 ticks over two seconds into just 8 batched flushes. Feeds where a smaller set of rows changes very often coalesce even more.

Also Read: https://www.sencha.com/blog/web-application-development-top-frameworks/

Step 2: Apply each batch to the store in one pass

The flush function writes the batch into the grid’s Ext JS store. Wrapping the loop in beginUpdate() and endUpdate() tells the store to hold its change notifications until the whole batch is in, so the grid refreshes once per flush instead of once per row:


    // src/live/applyTicks.ts
    import type { Tick } from './tickBuffer';

    export function applyTicks(store: any, ticks: Tick[]) {
      store.beginUpdate();
      try {
        for (const tick of ticks) {
          const record = store.getById(tick.symbol);
          if (!record) continue;                 // ignore symbols this grid isn't showing

          const previous = record.get('price');
          record.set(
            {
              price: tick.price,
              volume: tick.volume,
              change: tick.price - record.get('open'),
              direction: tick.price > previous ? 'up' : tick.price < previous ? 'down' : record.get('direction'),
            },
            { commit: true },                    // live values aren't user edits
          );
        }
      } finally {
        store.endUpdate();
      }
    }

Why each choice:

  • getById finds the row directly by its ID, so applying a batch doesn’t scan the whole store.
  • One set call per record changes several fields at once, so each row is marked changed once.
  • commit: true stops live values from showing as unsaved edits, the small red markers grids use for dirty cells.
  • direction records whether the price went up or down, which the grid uses for highlighting in the next step.

This is also where the data stays out of React. The live values flow from the socket into the store, and React never re-renders for a price tick.

Step 3: The live grid in ReExt, with change highlighting

Now connect the pieces in a React ui component. The grid’s configuration is created once; the buffer starts when the grid is ready and stops when the component unmounts. A renderer colors each price cell by the direction of its last change:


    // src/screens/LivePrices.tsx
    import { useEffect, useMemo, useRef } from 'react';
    import ReExt from '@sencha/reext';
    import { createTickBuffer } from '../live/tickBuffer';
    import { applyTicks } from '../live/applyTicks';
    import { connectPriceFeed } from '../live/priceFeed';

    type Instrument = { symbol: string; name: string; open: number; price: number };

    export function LivePrices({ instruments }: { instruments: Instrument[] }) {
      const gridRef = useRef<any>(null);
      const cleanupRef = useRef<() => void>();

      const config = useMemo(() => ({
        title: 'Live prices',
        store: {
          fields: [
            { name: 'symbol', type: 'string' },
            { name: 'price', type: 'float' },
            { name: 'open', type: 'float' },
            { name: 'change', type: 'float' },
            { name: 'volume', type: 'int' },
            { name: 'direction', type: 'string' },
          ],
          idProperty: 'symbol',
          data: instruments,
        },
        columns: [
          { text: 'Symbol', dataIndex: 'symbol', width: 110, locked: true },
          { text: 'Name', dataIndex: 'name', flex: 1 },
          {
            text: 'Price', dataIndex: 'price', width: 120, align: 'right',
            renderer: (value: number, meta: any, record: any) => {
              meta.tdCls = record.get('direction') === 'up' ? 'tick-up'
                : record.get('direction') === 'down' ? 'tick-down' : '';
              return Ext.util.Format.number(value, '0,000.00');
            },
          },
          {
            text: 'Change', dataIndex: 'change', width: 110, align: 'right',
            renderer: (value: number, meta: any) => {
              meta.tdCls = value >= 0 ? 'change-pos' : 'change-neg';
              return Ext.util.Format.number(value, '+0,000.00');
            },
          },
          { text: 'Volume', dataIndex: 'volume', width: 110, align: 'right',
            xtype: 'numbercolumn', format: '0,000' },
        ],
      }), [instruments]);

      const startFeed = (grid: any) => {
        gridRef.current = grid;
        const store = grid.getStore();
        const buffer = createTickBuffer((ticks) => applyTicks(store, ticks), 250);
        const disconnect = connectPriceFeed('wss://example.com/prices', buffer.push);
        cleanupRef.current = () => { disconnect(); buffer.stop(); };
      };

      useEffect(() => () => cleanupRef.current?.(), []);

      return <ReExt xtype="grid" style={{ height: 560 }} config={config} ready={startFeed} />;
    }

And the CSS for the highlights:


    .tick-up   .x-grid-cell-inner { color: #1b7f3b; }
    .tick-down .x-grid-cell-inner { color: #b42318; }
    .change-pos .x-grid-cell-inner { color: #1b7f3b; }
    .change-neg .x-grid-cell-inner { color: #b42318; }

What this setup gives you:

  • No React re-renders per tick. The component renders once; updates flow from the socket to the buffer to the store.
  • Rows found by symbol. idProperty: ‘symbol’ makes getById work with the feed’s IDs.
  • A locked symbol column, so the instrument stays visible while users scroll across wide grids.
  • Readable change cues. Color shows the direction of each move; keep it to text color, since flashing backgrounds at four updates a second are tiring to watch and can be an accessibility problem.
  • Fast rendering at any size. The Ext JS grid uses buffered rendering, so only rows in view are drawn when a batch is applied.

Step 4: The WebSocket connection, reconnects and a mock feed

Connecting to the feed

The connection’s only job is to parse messages and push them into the buffer. It also reconnects with a growing delay if the connection drops, so a brief network problem doesn’t leave the grid frozen on stale prices:


    // src/live/priceFeed.ts
    import type { Tick } from './tickBuffer';

    export function connectPriceFeed(url: string, onTick: (tick: Tick) => void) {
      let socket: WebSocket | null = null;
      let retryMs = 1000;
      let closed = false;

      const open = () => {
        socket = new WebSocket(url);
        socket.onopen = () => { retryMs = 1000; };
        socket.onmessage = (event) => {
          try {
            const message = JSON.parse(event.data);
            // Feeds often send arrays of ticks in one message
            (Array.isArray(message) ? message : [message]).forEach(onTick);
          } catch {
            // ignore malformed messages
          }
        };
        socket.onclose = () => {
          if (closed) return;
          setTimeout(open, retryMs);
          retryMs = Math.min(retryMs * 2, 30000);   // back off up to 30 seconds
        };
      };

      open();
      return () => { closed = true; socket?.close(); };
    }

In production, also show users when the feed is disconnected, for example with a status indicator in the grid’s toolbar, so nobody trades on prices they think are live.

A mock feed for development and testing

To build and test the screen before the real feed is available, swap connectPriceFeed for a mock that generates random price movements at a configurable rate:


    // src/live/mockFeed.ts
    import type { Tick } from './tickBuffer';

    export function startMockFeed(symbols: string[], ratePerSecond: number, onTick: (tick: Tick) => void) {
      const prices = new Map(symbols.map((s) => [s, 100 + Math.random() * 100]));
      const perBatch = Math.ceil(ratePerSecond / 20);   // 20 bursts a second

      const timer = setInterval(() => {
        for (let i = 0; i < perBatch; i++) {
          const symbol = symbols[(Math.random() * symbols.length) | 0];
          const price = Math.max(1, prices.get(symbol)! * (1 + (Math.random() - 0.5) * 0.002));
          prices.set(symbol, price);
          onTick({ symbol, price: Math.round(price * 100) / 100, volume: (Math.random() * 10000) | 0 });
        }
      }, 50);

      return () => clearInterval(timer);
    }

Call it with a high rate, such as startMockFeed(symbols, 5000, buffer.push), to see how the screen behaves under load long before production traffic arrives.

Tuning, measuring and common pitfalls

Choosing the flush interval

Interval Feel Good for
100 ms Near-instant Small grids where every move matters, such as an order book
250 ms Live, still easy to read Most trading and monitoring screens
500 ms to 1 s Calm and steady Dashboards, logistics and IoT overviews

Start at 250 ms and adjust with users. A faster interval costs more work for little visible gain; a slower one feels stale.

Measuring what matters

Use the browser’s DevTools Performance panel while the feed runs at full rate, and check:

  • Long tasks: look for main-thread work over 50 ms around each flush.
  • Input responsiveness: scroll, click and type in a filter while updates are flowing; all three should feel immediate.
  • Memory over time: memory should stay flat during a long session, not climb with every batch.

Test with your real column count and on the hardware your users have, not only on a developer workstation.

Pitfalls to avoid

  • Live data in React state. It re-renders the component tree on every update. Keep live values in the store.
  • Sorting by a live column. If users sort by price, rows reorder on every flush and selections jump. Consider sorting by a stable column by default, or refreshing the sort on a slower schedule or on demand.
  • Updating rows that aren’t loaded. For very large universes, filter the feed on the server to the rows the user can see, or subscribe only to the symbols in view.
  • Heavy renderers. Renderers run for every visible changed cell on every flush. Keep them to simple formatting.
  • Animations at high rates. Flashing or animated cells look good at one update a second and overwhelming at four. Use color, not motion.
  • Silent disconnects. Always show connection status, and mark data as stale if the feed stops.

Frequently asked questions

How do I stop a React grid from freezing with real-time updates?

Don’t apply each update as it arrives. Buffer updates, keep only the latest value per row, flush the buffer to the grid on a fixed interval such as every 250 milliseconds, and apply each batch in a single pass with change notifications suspended.

Should real-time grid data live in React state?

Not for high-frequency data. Putting every tick in React state re-renders the component tree each time. Send updates straight to the grid’s data store, and keep React state for things like selections and settings.

How often should a real-time grid refresh?

For most trading and monitoring screens, two to ten refreshes a second is enough; people can’t read changes faster than that. Around 250 milliseconds is a good starting point.

How do I highlight price changes in a React grid?

Store the direction of each change on the row, and use a cell renderer to add a CSS class, for example green text for up and red for down. Prefer color over flashing animations at high update rates.

Can ReExt handle real-time data?

Yes. The Ext JS grid in ReExt updates individual records in its store, supports batched updates with beginUpdate and endUpdate, and uses buffered rendering so only visible rows are redrawn. ReExt 1.2.0 supports Ext JS 8.0.

Fast data, calm screens

A real-time grid doesn’t have to show every update the instant it arrives. It has to show the latest value, reliably, without getting in the user’s way. Buffering, coalescing, scheduled flushes and batched store updates turn thousands of updates a second into a few smooth refreshes, while keeping React out of the hot path.

The Ext JS grid in React, through ReExt, gives you the pieces this pipeline needs: a record-level data store, batched updates, renderers for change highlighting and buffered rendering for any number of rows.

Next steps: start a 30-day ReExt trial, read How to Handle Millions of Rows in a React Data Grid, or see React Data Grid: The Complete 2026 Guide for Enterprise Apps.

Sencha CTA Banner: Try Sencha ReExt

Author

Team Sencha

Team Sencha is a team of software developers, technology experts, and product specialists with deep experience in building and delivering enterprise-grade web applications. Through our articles, we share practical insights, technical expertise, and industry perspectives to help developers and businesses build better, faster, and more scalable applications with Sencha technologies.