If you are like me when you come across a new technology there is one small moment of frustration but after you start reading the documentation and examples, you get more and more interested in it and want to start trying it even before you finished skimming the docs.
This is the case with me and GraphQL… once again.
In my previous job I had some communication with one of the ProductHunt iOS app’s developers. He told me about…
Do you know what is the difference between a class component and a function component in React?
In this practical guide I will try to explain how the component’s state is managed in both components after the second got on steroids!
In the previous example, we mentioned the two types of components — the class-based components that can have internal state and the function component that are stateless, i.e. cannot have a state.
If you have any experience with React, you most certainly used the setState() method. Let’s review this simple class component:
It’s fairy simple… 🙃
Create a new file in your React Native project’s root dir with name
Now, if you’re exporting for Android, go to:
$PROJECT_ROOT/android/app/src/main/assets/fonts and paste your fonts.
Go back to your project’s root dir and execute this command in the terminal:
Run the app with:
And that is all! 🥳
This article was originally posted here: https://www.seishin.me/lets-add-custom-font-to-a-react-native-app/
Today, I will try to rewrite the example with the latest big thing in React world — React Hooks! I’m so excited about this addition since writing functional components are much better solution than the class-based way! With them is much more easier to code, test and maintain and after the hooks introduction — they’re on steroids with state management and handling lifecycle events! 🚀
So, lets dive in the revised example with hooks!
In this article I’ll try to explain in a simple way what are the React Hooks and why it’s good to use them when developing your React/React Native apps.
Since React 16.8.0, there is a new way of calling async code in a really elegant way as well as reuse logic between components much more easily.
If you’re not new to React, you will most probably know that there are two type of components — stateful and stateless. …