React Native: Execution failed for task ‘:app:transformDexArchiveWithExternalLibsDexMergerForDebug’

Got same error a couple of days back, seems you’ve got to enable multidex to true and delete the build folder. Go to android/app/build.gradle and add the line multiDexEnabled true and set minSdkVersion to 21 inside defaultConfig like this … android{ … defaultConfig { … minSdkVersion 21 multiDexEnabled true } … } … You can … Read more

React Native persistent scrollbar

iOS The underlying iOS native component, UIScrollView (technically, RCTEnhancedScrollView), doesn’t support keeping the scroll indicators visible. For this reason, the React Native wrapper around it won’t either. There is a hack to get this working with the native component (see this answer for one approach). To accomplish this in React Native, you’d need to implement … Read more

How to use import with absolute paths with Expo and React Native?

Update: Expo v32.0.0 and up Expo init is creating a babel.config.js for you. Just add the plugins key to your babel.config.js file and add your alias. The env key is not needed anymore. module.exports = function(api) { api.cache(true) return { presets: [‘babel-preset-expo’], plugins: [ [ ‘module-resolver’, { alias: { assets: ‘./assets’, components: ‘./src/components’, modules: ‘./src/modules’, … Read more

What are the differences between different implementations of SafeAreaView?

Overview Except for the one in react-native they build on top of one another. All the others instruct that you need to wrap your whole app inside a SafeAreaProvider component. I dug into the source code a bit and this is my deductions: react-native The default implementation provided with React Native. Should work for most … Read more

react-native-render-html: “You seem to update the X prop of the Y component in short periods of time…”

Usually, this warning shows up when: The parent (currently App) component updates very often and causes WebDisplay component to re-render. In the provided snippet, every 30 milliseconds; At least one prop passed to RenderHTML is referentially unstable between each re-render. In the provided snippet, tagsStyles reference changes on every re-render. Notice that between every update … Read more

ios keyboard covers the input which is located in the bottom of the screen

Check the documentation for React Native Keyboard Avoiding View. It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard. It can automatically adjust either its position or bottom padding based on the position of the keyboard. Example from the How to make … Read more

React Native horizontal FlatList with multiple rows

Please do not use horizontal={true}. For this case you should use numColumns equal to the length of data / 2, and add a <ScrollView> tag. Forcing the number of columns to be half the total will force the list to wrap to the next line. <ScrollView horizontal showsHorizontalScrollIndicator={false} directionalLockEnabled={true} alwaysBounceVertical={false} > <FlatList contentContainerStyle={{alignSelf: ‘flex-start’}} numColumns={Math.ceil(listData.length … Read more