Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix metro config and patch draggable flat list #54245

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const {getDefaultConfig: getReactNativeDefaultConfig} = require('@react-native/m
const {mergeConfig} = require('@react-native/metro-config');
const defaultAssetExts = require('metro-config/src/defaults/defaults').assetExts;
const defaultSourceExts = require('metro-config/src/defaults/defaults').sourceExts;
const { wrapWithReanimatedMetroConfig, } = require('react-native-reanimated/metro-config');
require('dotenv').config();

const defaultConfig = getReactNativeDefaultConfig(__dirname);
Expand All @@ -26,4 +27,4 @@ const config = {
},
};

module.exports = mergeConfig(defaultConfig, expoConfig, config);
module.exports = wrapWithReanimatedMetroConfig(mergeConfig(defaultConfig, expoConfig, config));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that it is also worth adding such a wrapper config metro, thanks to it errors reanimated on the console tell much more about what caused them.

In the case of this bug, this is what the bug looked like without the wrapper:

image

this is how it looked with the wrapper:

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link Reanimated docs that suggest doing this? @sumo-slonik

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading
Loading