React-Native, Scroll View Not Scrolling

It’s a typo: Your closing ScrollView tag is: </SCrollView> rather than </ScrollView>. You also need to add a style to the View container, here’s an example of what it should look like: return( <View style={{flex: 1}}> <ScrollView> <Text> TEST </Text> <Text> TEST </Text> <Text> TEST </Text> <Text> TEST </Text> … </ScrollView> </View> );

How do I display an animated gif in React Native?

For RN < 0.60 By default the Gif images are not supported in android react native app. You need to set use Fresco to display the gif images. The code: Edit your android/app/build.gradle file and add the following code: dependencies: { … compile ‘com.facebook.fresco:fresco:1.+’ // For animated GIF support compile ‘com.facebook.fresco:animated-gif:1.+’ // For WebP support, … Read more

How would I grow height upon text wrapping?

Thanks to react-native doc: https://facebook.github.io/react-native/docs/textinput.html You can do something like that: class AutoExpandingTextInput extends React.Component { state: any; constructor(props) { super(props); this.state = {text: ”, height: 0}; } render() { return ( <TextInput {…this.props} multiline={true} onChange={(event) => { this.setState({ text: event.nativeEvent.text, height: event.nativeEvent.contentSize.height, }); }} style={[styles.default, {height: Math.max(35, this.state.height)}]} value={this.state.text} /> ); } } 0.46.1 … Read more

React Native: npm link local dependency, unable to resolve module

The npm link command doesn’t work because React Native packager doesn’t support symlinks. After a little research, I discovered that there are two ways to go about it. Use haul packager in the example app. Haul supports symlinks, so you can use npm link as usual. Use local dependency via file:../ and then edit files … Read more

However, this package itself specifies a `main` module field that could not be resolved

After a long research MetroJS bundler default not compile typescript .ts and .tsx extension files. We need tell MetroJS bundler to compile .ts and .tsx files i solved this error by edit metro.config.js file in root project folder by following. Edited on September 2022 Added cjx and json extensions to below snippet All extensions listed … Read more

What’s the best way to get device locale in react native (iOS)?

There’s no need for an external library. You can find what you’re looking for in React’s Native Modules import { NativeModules } from ‘react-native’ // iOS: const locale = NativeModules.SettingsManager.settings.AppleLocale || NativeModules.SettingsManager.settings.AppleLanguages[0] // “fr_FR” // Android: const locale = NativeModules.I18nManager.localeIdentifier // “fr_FR” To test this, I changed the language on my device to French. Here’s … Read more