Uniwind Support
Keep Uniwind styling working on Boost-optimized components.
React Native Boost supports Uniwind versions >=1.6.2 <2 through its Metro integration. Uniwind Pro has not been tested and is not supported.
Optimized components retain className styles and Uniwind subscriptions.
Setup
Keep your existing Uniwind CSS setup. Apply withBoostConfig after withUniwindConfig and set the Uniwind integration flag to on:
// metro.config.js
const { getDefaultConfig } = require('expo/metro-config');
const { withUniwindConfig } = require('uniwind/metro');
const { withBoostConfig } = require('react-native-boost/metro');
module.exports = withBoostConfig(
withUniwindConfig(getDefaultConfig(__dirname), {
cssEntryFile: './global.css',
}),
{
integrations: { uniwind: 'on' },
}
);The default auto setting detects an active Uniwind Metro configuration. It does not enable the integration just because the package is installed. Set on to require that configuration. Set off only when transformed code does not use Uniwind.
Wrapper order matters. Boost must keep Uniwind's worker and resolver inside its own integration. This also keeps Metro's cross-file ancestor analysis available on supported Metro versions.
Limits
- The integration requires Metro. A Babel-only setup does not install required runtime components.
- Uniwind 1.6.1 and lower are not supported. Boost uses internal Uniwind hooks for component state and accent colors that are not available in these versions.
- Uniwind Pro has not been tested and is not supported.
- Elements with Unistyles styles keep their original wrappers when both integrations are active at the same time.