When React is a good fit
- You are building rich UI surfaces like popup, options, sidebar, or new tab.
- You want component reuse across extension pages and content-script UI mounts.
- You already use React in web projects and want the same development model in extensions.
Template examples
new-react
Build a React new-tab experience with a ready-to-run project structure.
content-react

new-react-router
React extension with client-side routing using React Router.
Usage with an existing extension
Add React to an existing extension with the steps below.Installation
Install React runtime dependencies:react-refresh and @rspack/plugin-react-refresh. Both ship as dependencies of extension-develop, so a healthy install already resolves them. When one cannot be resolved, the build fails to start and the error names the packages to install. The install command in the error is phrased for the package manager that your project uses.
Configuration
Common React file patterns:- JavaScript:
*.jsx - TypeScript:
*.tsx
Development behavior
In development mode, Extension.js enables React refresh integration when it detects React.- Extension.js uses
react-refreshand@rspack/plugin-react-refreshfor refresh behavior. - If the refresh packages cannot be resolved from your project or from
extension-develop, the build fails to start and prints that install command. Extension.js does not install them for you and does not ask for a restart. - Extension.js applies React aliases to keep a single React/runtime instance in your bundle.
Usage examples
In a new tab extension
Example page entry:In a content_script file
For content scripts, render React into an injected root element:
Next steps
- Start from the React template (
--template=react) when you want a sidebar panel plus a content script. - Learn more about TypeScript support.
- Explore how Extension.js handles Sass modules.

