
React4XP 6: A Modern Framework for Building Sites
With the newest version of React4XP, developers get more flexibility and better control. R4XP is now paired with Typescript tools and XP dev mode.
Written by Vegard Ottervig on
At a recent Enonic Meetup, CTO Thomas Sigdestad unveiled the next major evolution in front-end development for Enonic: React4XP version 6.
This release marks a significant leap forward, giving developers a more modern, structured, and flexible way to build full-featured websitesāusing only React.
Whether youāve worked with React4XP before or are exploring alternatives to frameworks like Thymeleaf or even Next.js, version 6 introduces several changes worth your attention.
See the presentation:
What Is React4XP?
React4XP is Enonicās own approach to server-side rendering with React, built natively into XP. Unlike other frameworks like Next.js, which require hosting a separate Node.js server, React4XP apps run directly inside XPāmaking them easier to deploy, maintain, and scale.
Where Next.js might be more suitable for large decoupled systems, React4XP offers deep integration with XPās content APIs, native preview support, and page caching.
It also features seamless compatibility with other Enonic features and apps such as SEO tools, sitemaps, and security headers. Itās ideal for teams that want to keep development streamlined while embracing modern frontend tooling.
Whatās New in Version 6?
Version 6 is a complete rethinking of how React and Enonic XP should work together. Key changes include:
- Headless-ready structure: React4XP 6 lets you separate front-end code from XP schemas, giving you the flexibility to reuse or share front-end logic across multiple sites or projects.
- Unified rendering pipeline: Instead of running multiple micro React apps per page, version 6 runs a single React app across your site, improving performance and maintainability.
- New app bootstrap layer: You now control routing and page rendering through
app.tsandapp.tsx, offering fine-grained control over request handling. - Standardized CSS Modules: CSS Modules are supported out of the box, simplifying styling consistency across components.
- TypeScript and improved build system: Development now benefits from stricter typing, faster builds, and better dev tooling.
- Component Registry and Data Fetcher: These two new concepts define how components get their data and render content. Each part of a page can declare its own data needs and rendering logic in a clean, declarative manner.
Live Demo Highlights
During the presentation, Thomas demonstrated how React4XP 6 can be layered on top of existing XP content.
Using the Headless Movie Database demo site, he showed how easily a React front-end can take over renderingācomplete with instant preview updates and hot-reloading during development.
By simply attaching a new React app to an existing site, developers can migrate to modern rendering techniques without having to touch underlying content or data models.
How It Works
Under the hood, React4XP 6 works by intercepting rendering using a catch-all mapping that routes requests to your custom app.ts. This file acts as a bootstrapping point, pulling in contextual content and orchestrating how the page is rendered.
The process flows through:
- Data Fetcher ā Determines what content components on the page need and fetches it using dedicated "data processors."
- Component Registry ā Maps parts to their React components for server-side rendering.
- Response Processor ā Optionally modifies the final HTML, making it possible to inject things like CSP headers or SEO tags.
- Client Rendering ā Once delivered to the browser, the app boots React on the client side.
Everything is developer-friendly and fully customizableāideal for teams that want control without the overhead of custom build systems.
Getting Started
You can start a new project using the updated starter:
enonic create my-site -r https://github.com/enonic/starter-react4xp6
This command gives you a working setup with React, TypeScript, CSS modules, and XP integrationāall pre-wired for development. You'll also find full documentation and a detailed upgrade guide for those migrating from React4XP 5.
For teams upgrading, note that previous Thymeleaf integration and region handling are not supported in version 6. The cleanest path is to start fresh, port over your front-end code, and reimplement page components using the new Data Fetcher and Component Registry.
Coming Soon
While version 6 is feature-rich already, more is on the way. Enonic plans to:
- Merge Data Fetcher and Component Registry for even simpler configuration
- Add GraphQL support via Guillotine (for those preferring client-side data queries)
- Support features like link prefetching, hot module reload, and more dev speedups
As always, your feedback will shape these features. Whether you're a developer building marketing sites, complex apps, or admin interfaces, Enonic wants to hear what works and what can be better.
React4XP 6 is available now. Itās fast, flexible, and made for modern front-end developmentāright inside Enonic XP.
š Ready to try it? Get started with React4XP 6 or explore the starter repo on GitHub.




