Modify the webpack config to use Preact instead of React:
const createExpoWebpackConfigAsync = require('@expo/webpack-config');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
module.exports = async (env, argv) => {
const config = await createExpoWebpackConfigAsync(env, argv);
config.resolve.alias = {
...config.resolve.alias,
react$: 'preact/compat',
'react-dom$': 'preact/compat',
'react-dom/unstable-native-dependencies$': 'preact-responder-event-plugin',
};
if (env.mode === 'production') {
config.plugins.push(
new BundleAnalyzerPlugin({
path: 'web-report',
})
);
}
return config;
};