Skip to content

Instantly share code, notes, and snippets.

View itsaalexk's full-sized avatar
:electron:
Focusing

Alex itsaalexk

:electron:
Focusing
View GitHub Profile
@Klerith
Klerith / useForm.js
Created June 6, 2022 19:58
useForm con Validaciones
import { useEffect, useMemo, useState } from 'react';
export const useForm = ( initialForm = {}, formValidations = {}) => {
const [ formState, setFormState ] = useState( initialForm );
const [ formValidation, setFormValidation ] = useState({});
useEffect(() => {
createValidators();
}, [ formState ])
@Klerith
Klerith / vite-testing-config.md
Last active July 22, 2024 19:01
Vite + Jest + React Testing Library - Configuraciones a seguir

Instalación y configuracion de Jest + React Testing Library

En proyectos de React + Vite

  1. Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react 
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
  1. Opcional: Si usamos Fetch API en el proyecto: