Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

react-native

Change App Name In React Native

November 20, 2022 by Tarik

The generator does not override the strings.xml file located in android/app/src/main/res/values/, so you have to change the app_name variable manually

Categories react-native Tags react-native Leave a comment

React Native: View onPress does not work

November 19, 2022 by Tarik

You can use TouchableOpacity for onPress event. View doesn’t provide onPress prop. <TouchableOpacity style={{backgroundColor: “red”, padding: 20}} onPress={()=> { console.log(‘does not work’); } }> <Text>X</Text> </TouchableOpacity>

Categories react-native Tags react-native Leave a comment

React Native TextInput that only accepts numeric characters

November 18, 2022 by Tarik

Using a RegExp to replace any non digit is faster than using a for loop with a whitelist, like other answers do. Use this for your onTextChange handler: onChanged (text) { this.setState({ mobile: text.replace(/[^0-9]/g, ”), }); } Performance test here: https://jsperf.com/removing-non-digit-characters-from-a-string

Categories react-native Tags react-native Leave a comment

How to check the installed version of React-Native

November 15, 2022 by Tarik

To see what version you have on your Mac(Window also can run that code.), run react-native -v and you should get something like this: If you want to know what version your project is running, look in /node_modules/react-native/package.json and look for the version key:

Categories react-native Tags react-native Leave a comment

Basic FlatList code throws Warning – React Native

November 15, 2022 by Tarik

Simply do this: <FlatList data={[{name: ‘a’}, {name: ‘b’}]} renderItem={ ({item}) => <Text>{item.name}</Text> } keyExtractor={(item, index) => index.toString()} /> Source: here

Categories react-native Tags react-native Leave a comment

Draw horizontal rule in React Native

November 15, 2022 by Tarik

You could simply use an empty View with a bottom border. <View style={{ borderBottomColor: ‘black’, borderBottomWidth: StyleSheet.hairlineWidth, }} />

Categories react-native Tags react-native Leave a comment

spawnSync ./gradlew EACCES error when running react native project on emulator

November 14, 2022 by Tarik

I fixed this problem with: chmod 755 android/gradlew the chmod command sets the permissions of files or directories. https://www.computerhope.com/unix/uchmod.htm

Categories react-native Tags android-gradle-plugin, gradle, react-native Leave a comment

React Native add bold or italics to single words in field

October 25, 2022 by Tarik

You can use <Text> like a container for your other text components. This is example: … <Text> <Text>This is a sentence</Text> <Text style={{fontWeight: “bold”}}> with</Text> <Text> one word in bold</Text> </Text> … Here is an example.

Categories react-native Tags react-native Leave a comment

How do you style a TextInput in react native for password input

October 24, 2022 by Tarik

When this was asked there wasn’t a way to do it natively, however this will be added on the next sync according to this pull request. Here is the last comment on the pull request – “Landed internally, will be out on the next sync” When it is added you will be able to do … Read more

Categories react-native Tags react-native Leave a comment

How do I add an element to array in reducer of React native redux?

October 22, 2022 by Tarik

Two different options to add item to an array without mutation case ADD_ITEM : return { …state, arr: […state.arr, action.newItem] } OR case ADD_ITEM : return { …state, arr: state.arr.concat(action.newItem) }

Categories react-native Tags react-native, react-redux, redux Leave a comment
Older posts
Newer posts
← Previous Page1 … Page32 Page33 Page34 Next →

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa