General Options and Styling Configuration for a React Native App

Tiempo de lectura: < 1 minuto Let’s see how to set up the general styles for an application developed in React Native. To do this, on the screen where the different screens and routes are established, within the StackNavigator, we will add the screenOptions. The screenOptions is an object that contains the style and layout options for the screens in navigation. … Read more

Comunicar una Web en React con un Frame dentro de React o web HTML con JavaScript usando postMessage()

Comunicar una Web en React con un Frame dentro de React o web HTML con JavaScript usando postMessage()

Tiempo de lectura: 2 minutos Today we’re going to see how we can communicate a web created with React with an iFrame or frame in React or HTML with JavaScript. Loading the Frame We create an iframe: <iframe src={urlCargar} style={{ width: ‘100%’, height: ‘500px’ }} /> In urlCargar we put the URL of the web from which we want to … Read more

Communicating a React Web with a React Native WebView using postMessage()

Communicating a React Web with a React Native WebView using postMessage()

Tiempo de lectura: < 1 minuto Today we are going to learn how we can communicate a web app created with React with a WebView in React Native, and also use the postMessage() function of JavaScript. This is very useful for creating interfaces with web content and implementing them within a mobile app. React Native We will use the library react-native-webview … Read more

Create a Barcode Scanner Using React

Create a Barcode Scanner Using React

Tiempo de lectura: 2 minutos Today we are going to learn how to implement a barcode scanner using React. The first thing we need to do is install the quagga2 library. You can also use quagga. npm install @ericblade/quagga2 –save Once installed, we are going to create a component called scanner.tsx import Quagga from ‘@ericblade/quagga2’; import React, { useEffect, useCallback … Read more

Add Open Street Maps with Leaflet in React and also compatible with Next.js

Add Open Street Maps with Leaflet in React and also compatible with Next.js

Tiempo de lectura: 2 minutos Today we are going to learn how we can create a map component compatible with Open Street Maps using the Leaflet library in React. The first thing we need to do is install the necessary library: npm install react react-dom leaflet And then the Leaflet library: npm install react-leaflet And if we need TypeScript (in … Read more

Create a Higher Order Component (HOC) using React

Create a Higher Order Component (HOC) using React

Tiempo de lectura: 2 minutos In React, this type of component is known as a “Higher Order Component” or “HOC”. An HOC is a function that takes a component and returns another component that usually provides additional functionality to the original component. Suppose we want to create an HOC called WrapperComponent that wraps another component called WrappedComponent and provides it … Read more

Fixing error Text content does not match server-rendered HTML Next.js

Fixing error Text content does not match server-rendered HTML Next.js

Tiempo de lectura: < 1 minuto Today we are going to fix the common error that may occur when implementing i18n in our React environment with Next.js. This is the error: Unhandled Runtime Error Error: Text content does not match server-rendered HTML. Warning: Text content did not match. Server: “” Client: “” See more info here: https://nextjs.org/docs/messages/react-hydration-error A different content appears … Read more

Button component using Flutter in Dart language

Button component using Flutter in Dart language

Tiempo de lectura: 2 minutos In this post, we will create a customizable button component in Flutter using the ElevatedButton widget. This component will allow us to create buttons with text, icon, and customize various aspects like color, text size, and button width. import ‘package:flutter/material.dart’; import ‘../util/constants/Colors.dart’; class Button extends StatelessWidget { final Color? color; // Now optional and can … Read more

Middleware file in Next.js

Middleware file in Next.js

Tiempo de lectura: < 1 minuto Today I’m going to explain and provide an example of middleware in Next.js A middleware in Next.js is a function that runs before a request reaches your Next.js route or API. You can use middleware to handle and manipulate incoming requests. Here are some things you can do with middleware in Next.js: Cookie handling: You … Read more