npm install -D babel-plugin-react-compiler@latest
# or using yarn
yarn add -D babel-plugin-react-compiler@latestReact Compiler
The React Native Chat SDK supports React Compiler. Enable it to improve performance.
React Compiler works best with React 19+. Use React Native CLI 0.80+ or Expo 54+. Older Expo versions may need extra configuration.
Best Practices
- Use a React/React Native version that fully supports the compiler.
- Place the compiler plugin first in
babel.config.js. - Verify production builds after enabling to catch plugin conflicts.
- Profile message list screens to confirm real-world gains.
- Keep third-party Babel plugins updated to avoid incompatibilities.
React Compiler Setup
Follow the React docs for setup: React Compiler.
For Expo, see: React Compiler for Expo.
For React Native CLI, you need to install the following dependencies:
Enable it in babel.config.js:
module.exports = {
plugins: [
"babel-plugin-react-compiler", // must run first!
// ... other plugins
],
// ... other config
};