External CSS vs JSX Within the Component in React

External CSS vs JSX Within the Component in React

Tiempo de lectura: 2 minutos The choice between using styles in an external CSS file or directly in JSX largely depends on your personal preferences, project needs, and team conventions. Both options have their advantages and disadvantages, and the “best” choice may vary depending on the context. Here are some points to consider for each approach: Styles in an external … Read more

Use Jest to unit test your React project

Use Jest to unit test your React project

Tiempo de lectura: 2 minutos Unit testing is an essential part of software development that ensures different parts of your application work correctly. In this tutorial, we will learn how to write unit tests for a React component using Jest and @testing-library/react. Prerequisites Make sure you have Node.js and npm installed on your machine before starting. You can verify this … Read more

Implement asynchronous calls for Rest API with Axios and also optimize them with React Query

Implement asynchronous calls for Rest API with Axios and also optimize them with React Query

Tiempo de lectura: 3 minutos In today’s article, we will explore a way to implement Axios (which replaces the fetch or ajax in JavaScript for React). Additionally, we will optimize calls using React Query, caching those made on certain occasions to avoid a high number of server calls. First, let me explain each mentioned technology: React Query is a state … Read more

Implement local.storage in React to allow storing variables in memory

Implement local.storage in React to allow storing variables in memory

Tiempo de lectura: 4 minutos In order to store variables locally, we need to implement local storage, and just like in web development, we can use it in React. Let’s get started: Step 1: Import Necessary Modules Make sure you have the necessary modules installed. You can install react and react-dom if you haven’t already: npm install react react-dom Step … Read more

Add internationalization (different languages) to your website using i18next and React

Add internationalization (different languages) to your website using i18next and React

Tiempo de lectura: 2 minutos Today we are going to learn how to integrate internationalization and different languages using i18next (https://react.i18next.com/) and React, and also achieve browser language detection. To implement internationalization with i18next in your React application, you first need to install i18next and its related modules, such as react-i18next. Then, configure i18next so that it can load translations … Read more

Install Material UI (Material Design) for React

Install Material UI (Material Design) for React

Tiempo de lectura: 2 minutos Material UI is a framework for developing interfaces based on Google Material Design. Personally, I like this design style a lot, both for its components and color palette, striking a balance between usability and modern design. Let’s learn how to install this framework into our React project. You can find more about this framework here. … Read more

Applying a Patch, Command, or Dependency Installation When Generating a Build with Expo in React Native

Applying a Patch, Command, or Dependency Installation When Generating a Build with Expo in React Native

Tiempo de lectura: 2 minutos Reading Time: < 1 minutes I’m going to explain how you can run the installation of an npm package with flags or any other command when generating a build with React Native: In this case, we need to apply this dependency installation: npm i react-native-picker-select –save –legacy-peer-deps Step 1: Create an .npmrc File First, create … Read more

Undoing a patch applied with patch-package in React Native

Undoing a patch applied with patch-package in React Native

Tiempo de lectura: 2 minutos To remove a patch that you previously applied using patch-package, follow these steps: Open a terminal in the root of your project where the package.json file is located. Execute the following command to undo the patch: npx patch-package –reverse [package-name] Replace [package-name] with the name of the package for which you want to undo the … Read more

Actualizar target versión de Android o iOS en React Native Expo

Actualizar target versión de Android o iOS en React Native Expo

Tiempo de lectura: < 1 minuto html Copy code Reading Time: < 1 minute Hello, today we will see how we can update the target version of Android / iOS using React Native. This way, we can upgrade to version 33, which Google Play requires for app updates starting from August 31. Inside our React Native project, we add this dependency: … Read more