Adding YouTube Video in React

Adding YouTube Video in React

Tiempo de lectura: < 1 minuto Today we’re going to learn how we can add a YouTube video in React. The first thing we need to do is to add this dependency: npm install react-youtube –save Once installed, let’s create the component responsible for opening the YouTube video. We’ll call it YoutubePlayer.tsx You can customize the options by adding playerVars: reference. … Read more

Setting up ESLint for React or React Native project with JavaScript or TypeScript

Setting up ESLint for React or React Native project with JavaScript or TypeScript

Tiempo de lectura: 3 minutos Today we are going to learn how we can set up ESLint for a project that uses React and React Native with JavaScript or TypeScript. This will allow us to recognize errors that appear in our code and configure the type of error we want. Returns only the HTML translated, without any additions.HTML: First of … Read more

Nginx Container for React with Docker Compose

Nginx Container for React with Docker Compose

Tiempo de lectura: < 1 minuto Today I’m going to share a container setup for React based on Nginx. To do this, we are going to create this docker-compose.yml Now we are going to create our Dockerfile Finally, we will create the necessary folders: The nginx.conf file must contain: Remember that the React distribution folder generated with Vite is inside dist, … Read more

Avoiding the Keyoard from Hiding the User Interface in React Native

Tiempo de lectura: 2 minutos The KeyboardAvoidingView is a component in React Native that helps manage keyboard behavior on mobile devices, especially on small screens. When a text field or input is selected and the keyboard appears, The KeyboardAvoidingView adjusts the position of components on the screen to prevent them from being covered by the keyboard. You should use KeyboardAvoidingView … Read more

Adding YouTube Video in React

Adding YouTube Video in React

Tiempo de lectura: < 1 minuto Today we’re going to learn how we can add a YouTube video in React. The first thing we need to do is to add this dependency: npm install react-youtube –save Once installed, let’s create the component responsible for opening the YouTube video. We’ll call it YoutubePlayer.tsx You can customize the options by adding playerVars: reference. … Read more

Nginx Container for React with Docker Compose

Nginx Container for React with Docker Compose

Tiempo de lectura: < 1 minuto Today I’m going to share a container setup for React based on Nginx. To do this, we are going to create this docker-compose.yml Now we are going to create our Dockerfile Finally, we will create the necessary folders: The nginx.conf file must contain: Remember that the React distribution folder generated with Vite is inside dist, … Read more

Create Development Build with React Vite

Create Development Build with React Vite

Tiempo de lectura: < 1 minuto Today we are going to learn how we can generate a development build with React Vite. This will generate the dist folder with development configuration. To do this, we need to go to the package.json file and add this command inside “scripts”: { Returns only the HTML translated, without any additions. npm build-dev This way … Read more

Implementing Vitest in a React Environment with Vite for Unit Tests

Implementing Vitest in a React Environment with Vite for Unit Tests

Tiempo de lectura: 2 minutos Today we are going to learn how we can install Vitest in a React environment with Vite. First, we will install Vitest: npm install -D vitest After we will install the necessary libraries: npm install vitest @testing-library/react @testing-library/jest-dom –save-dev Now let’s create the directory structure for the tests, outside our src folder: And within components, … Read more