How am I categorizing my blog posts?

The main purpose of creating blog posts is to learn and document. To keep it standard and focused, I am categorizing my posts into 4 different categories. The four categories are below Code ReadToday I learnedTutorialPersonal Code Read As a programmer, it is very important that we read others code. We programmers are like writers and writers always keep on reading in order to improve their own writing. Similarly this is my personal growth plan. I am planning to read a small block of code every day, whatever I find interesting. I try to understand the code and then try…
Creating a reusable “Token Manager” class in react-native.

Creating a reusable “Token Manager” class in react-native.

In any app, especially an app that has user accounts, it is a very common task to check for existing user token and redirects the user either to AuthStack or AppStack according to the token found. So for this common task, we can create our own token manager class which handles the common functionalities related to user token. In today's code read I will try to document that. Usually, we store tokens locally in our AsyncStorage, so we have 2 functions in our class. One is to set and the other one is to clear the token. Now the next…
MultiSelected List in React Native

MultiSelected List in React Native

In today's code-read, I read through how to implement multi-selected inputs. All we need to do is to control an array with selected items.  let's say in our demo user can select his favorite brands from a list of options. First, we need to show all the inputs to the user. We can use FlatList to render the items. Like so - const BRANDS = [ { name: 'Toyota', slug: 'toyota', }, { name: 'Mazda', slug: 'mazda', }, { name: 'Honda', slug: 'honda', }, { name: 'Tesla', slug: 'tesla', }, .....] export default function App() { const [brands, setBrands] =…

Dynamically add height to the ScrollView with Sticky Footer

In another post, we have seen how to add a sticky footer with ScrollView. One problem occurs if we put a sticky footer in the ScrollView, is that the last part of ScrollView gets hidden/ gets overlapped with the sticky footer. We need to add a proper padding-bottom to the ScrollView so that the last content of the ScrollView is also visible and there is no extra white space when the user scrolls to the bottom. The problem can be seen in the following image. When we scroll down, the sticky footer is overlapping with the red view and the…