Skip to content
Advertisement

Tag: reactjs

How to add custom Icons to NativeBase

I have the .ttf and .svg files for customized icons that I designed. But I would like to import them into my NativeBase project, making them available for use in NB’s <Icon /> component. How can I achieve this? Answer React Native Custom Icon Font for NativeBase Adopted from: https://medium.com/@kelleyannerose/react-native-custom-icon-font-with-no-sad-red-screen-72b8d09a0e7b This is what worked for me 🙂 Step 0: React

How to deal with a ref within a loop?

Below is my parent component with multiple inputs from a loop. How can I choose one input to focus? Do I have to create a dynamic ref in this case? Answer You can use callback refs to generate and store the dynamic ref of each input in an array. Now you can refer to them using the index of the

How to allow only English letters in input fields?

So, this is my input field: How can I allow only English letters? This is the RegEx, I believe I should use: /[A-Za-z]/ig https://regex101.com/r/upWFNy/1 I am assuming that onChange() event should be used for this with the combination of setState() and event.target.value. Thanks. PS. I need to have this WHILE typing. Answer I would try this onChange function: See the

Advertisement