For AI agents: the complete documentation index is available at https://rsbuild.rs/llms.txt, the full documentation bundle is available at https://rsbuild.rs/llms-full.txt, and this page is available as Markdown at https://rsbuild.rs/guide/framework/react-lynx.md.
close

ReactLynx

Learn how to build a ReactLynx application for Lynx using Rsbuild.

Create a ReactLynx application

Create a ReactLynx application with @lynx-js/create-lynx:

npm
yarn
pnpm
bun
npm create @lynx-js/lynx@latest

Then select Rsbuild when prompted to "Select build tool".

Use ReactLynx in an existing project

To compile ReactLynx, you need to register the ReactLynx plugin provided by Lynx. The plugin will automatically add the necessary configuration for ReactLynx builds.

Install @lynx-js/react and the plugin:

npm
yarn
pnpm
bun
deno
npm add @lynx-js/react
npm
yarn
pnpm
bun
deno
npm add @lynx-js/react-rsbuild-plugin -D

Then register the plugin in Rsbuild config, and name the environment lynx so that it is built into a Lynx bundle:

rsbuild.config.ts
import { defineConfig } from '@rsbuild/core';
import { pluginReactLynx } from '@lynx-js/react-rsbuild-plugin';

export default defineConfig({
  environments: {
    lynx: {},
  },
  plugins: [pluginReactLynx()],
});

For more details, see the ReactLynx documentation.