React in open-source AI tools: the UI library behind LibreChat, LobeChat, Dify and Langflow in 2026
What React does
React describes an interface as a tree of components, each a function that takes data and returns what should appear on screen. When data changes, React works out what changed and updates only those parts of the page. That model handles the constant small updates of an AI chat well: each new token changes one message, and React re-renders that message without touching the rest of the thread.
Which directory projects use it
| Project | What it is | React setup |
|---|---|---|
| LibreChat | Multi-provider chat | React single-page app built with Vite |
| LobeChat | Chat with plugins and agents | React in Next.js |
| Dify | LLM app platform | React in Next.js, with a visual workflow editor |
| Langflow | Visual flow builder | React with React Flow for the canvas |
| CopilotKit | Framework for in-app copilots | React components and hooks |
| AnythingLLM | Document chat and agents | React with Vite, packaged in Electron for desktop |
Flow editors deserve a mention. Dify, Langflow and many agent builders use React Flow, an open-source library for node-and-edge canvases, to let users drag model calls, tools and conditions into a workflow. It is a large reason so many visual AI builders are React apps.
React 19 and 19.3
React 19, released in December 2024, added Actions for handling form submissions and pending states, the use hook for reading promises and context, server components and server actions as stable features for frameworks, and document metadata support. React Compiler 1.0, released in October 2025, automates the memoization that developers used to write by hand with useMemo and useCallback, which reduces wasted re-renders in busy interfaces such as long chat threads.
React 19.3.0, on September 9, 2026, made two features stable. View Transitions animate between states using the browser's View Transitions API, for example when a message moves from pending to complete or a panel opens. Fragment Refs let a ref attach to a group of sibling elements without an extra wrapper element, useful for focus management and measuring layout.
The React Foundation
In October 2025, Meta announced that React and React Native would move to a new React Foundation under the Linux Foundation, with founding members including Amazon, Callstack, Expo, Microsoft, Software Mansion and Vercel. Day-to-day development continues with largely the same core team, but decisions about the project's direction and funding are now shared. For people building on React, the practical effect is more confidence that the library does not depend on one company's priorities.
Chat interface patterns
Most AI chat front ends solve the same problems:
| Problem | Common approach |
|---|---|
| Streaming text | Append chunks to the last message in state; render Markdown incrementally |
| Rendering Markdown and code | react-markdown or a streaming-aware renderer, with syntax highlighting |
| Tool calls | Show a card per call with arguments, status and result |
| Long threads | Virtualize the list so only visible messages render |
| Stopping generation | Abort the fetch with an AbortController and mark the message stopped |
| Generative UI | Map tool results to custom components, such as a chart or a booking form |
Libraries cover much of this. The Vercel AI SDK's useChat hook manages messages, streaming and tool calls; assistant-ui provides polished, accessible chat components; CopilotKit adds copilots that can read app state and take actions in the interface, and supports the AG-UI protocol for connecting agent back ends to front ends.
State management in AI front ends
Chat apps hold more state than most interfaces: conversation lists, the active thread, streaming status, model settings, uploaded files and tool results. Small apps keep this in React state and context. Larger ones use a store: LobeChat uses Zustand, a small store library popular in AI projects, and many apps use TanStack Query to fetch and cache server data such as conversation history. A useful rule is to keep the streaming message separate from the rest of the thread, so each new token updates one component instead of re-rendering the whole conversation list.
Security
React itself running in the browser has a small attack surface, and it escapes text by default, which blocks most script injection. Two risks matter for AI apps. First, rendering model output as raw HTML with dangerouslySetInnerHTML invites injection, because model output can contain anything a user or a poisoned document put into the prompt; render Markdown through a sanitizing renderer instead. Second, server components run on the server: CVE-2025-55182, disclosed in December 2025, was a critical remote code execution flaw in React Server Components, exploited in the wild soon after disclosure. Apps using server components through Next.js or other frameworks needed patched versions immediately.
Building and hosting
React apps are built by a framework or bundler. Vite is the standard choice for single-page apps and produces static files any web server or CDN can serve. Next.js and React Router 7 add server rendering. For self-hosters, a single-page React front end is usually served by the project's own back end or an Nginx container, and needs no Node.js server of its own.
Styling
Most AI projects pair React with Tailwind CSS and a component library. shadcn/ui, which copies accessible components built on Radix UI into your project rather than installing them as a package, has become the most common choice for new AI interfaces, and it is what tools such as v0 generate. Ant Design and its AI-focused Ant Design X are popular with projects that come from China, including LobeChat.
Accessibility in AI interfaces
Chat interfaces bring accessibility problems that ordinary pages do not. Screen readers can announce every streamed token, flooding the user; a live region that announces only completed messages works better. Keyboard users need a way to stop generation, copy a code block and move between messages without a mouse. Tool-call cards and expandable reasoning sections need proper button roles and labels. Radix UI and React Aria handle much of this at the component level, but the streaming behavior is up to each app. Test with VoiceOver or NVDA before calling a chat interface finished.
React compared with other front-end options
| Library | Used by | Notes |
|---|---|---|
| React | LibreChat, LobeChat, Dify, Langflow | Largest library collection, most AI chat components |
| Svelte | Open WebUI | Less code and smaller bundles; fewer ready-made AI components |
| Vue | n8n | Strong in visual editors; Vue 3.6 adds Vapor Mode |
| Solid | Some newer tools | Fine-grained updates, React-like syntax |
Contributing
React AI projects usually use TypeScript, Vite or Next.js, Tailwind, and Vitest or Jest with Testing Library. Run the dev server with hot reload, keep components small, and avoid putting the entire chat history in one top-level state object that re-renders everything on each token. React DevTools' profiler shows which components re-render while a reply streams, which is the fastest way to find slow spots.
Related: Next.js stack, Vite stack, Tailwind CSS stack, TypeScript stack, JavaScript stack, Stack index.
Frequently asked questions
What is new in React 19.3?
React 19.3.0, released September 9, 2026, made View Transitions stable, which animate between UI states using the browser's View Transitions API, and made Fragment Refs stable, which let a ref point at a group of elements without a wrapper. Both had been available in canary builds.
What is the React Foundation?
Announced in October 2025, the React Foundation is an independent body under the Linux Foundation that governs React and React Native. Meta and other companies, including Vercel, Microsoft and Amazon, are members. It moved React from single-company ownership to shared governance.
Do I need Next.js to use React for an AI app?
No. React works as a single-page app built with Vite, which LibreChat, AnythingLLM and Langflow use. Next.js adds server rendering and server routes, which some projects such as LobeChat and Langfuse prefer.
What libraries provide React chat components?
The Vercel AI SDK's useChat hook manages messages and streaming; assistant-ui offers styled, composable chat components; CopilotKit adds in-app copilots and agent interfaces. Many projects build their own on top of a component library such as shadcn/ui.
Was React affected by a security vulnerability?
Yes. CVE-2025-55182, disclosed in December 2025, was a critical remote code execution flaw in React Server Components, affecting frameworks such as Next.js that use them. Apps that only run React in the browser were not affected. Patched versions were released quickly.