Reagent wraps React so you define components as ClojureScript functions with Hiccup-like markup, reactive atoms, and standard React mounting APIs.
Overview
Reagent provides a thin layer between ClojureScript and React for building browser UIs without JSX. Components are ordinary functions that return Hiccup-style vectors; nesting and props follow familiar functional patterns. You mount trees with the React DOM client helpers and can still use React components, hooks, and ecosystem libraries underneath.
State uses Reagent's atom, which re-renders any component that derefs it when values change. Cursors and shared atoms support forms and calculators-style flows. A component may return an inner render function to set up timers or local state without leaning on every React lifecycle callback, though metadata and create-class remain available.
The library expects React (and typically React DOM) from npm or cljsjs packages and works with shadow-cljs and template projects for new apps. Documentation covers live examples, a getting-started path, and API reference material on the project site.
Reagent aims to keep the conceptual surface small—functions, data, atoms, and one main mount entry point—while delegating rendering and reconciliation to React.
Key features
- Hiccup-like markup instead of JSX
- Reactive atoms for component state
- Composable function components
- React 18 and 19 compatibility
- Optional inner render functions
- Direct use of React libraries
- Class attribute collections support
- ClojureScript performance caching
Use cases
- ClojureScript single-page web apps
- React UIs without JSX templates
- Interactive forms and counters
- Migrating cljs apps to React
- Teaching cljs front-end patterns