Skip to main content

SlashLogs

Tag: react

How to create a private component library

How to create a private react component library. While developping apps a some of our code can, and should be, shared between apps, so we can learn once and perfect it in other deployments and so use it more. Copy and paste is an option, but rapidly it will be a headache to mantain and track where did you use it when you need to update something. With that in mind the best is to have a place to store your shared code and have the apps pulling those components when they need it.

How to inject authorization header on all axios requests

While using a frontend client like React you often find yourself calling the backend and using the same code to give axios a JsonWebToken or an Api Key to authorize the client and fulfill the request in the backend code. Instead of passing the authorization token you can handle and instruct axios to save you from that boilerplate code. Axios is a very usefull http client library that can make a lot for us.

How to change Android package name in a React Native App

In Android the package name is an identifier of your app. In an android device every app should have an identifier for that app and that identifier is the package name. That's true to publish your app in Google's Play Store as well, just like any' android published app store. Just like in a java package the convention is your domain name in reverse, like : com.slashlogs.myawesomeapp. In this tutorial we gonna learn how to set up that package name for our app in React Native.