- Instalaciones:
yarn add --dev jest babel-jest @babel/preset-env @babel/preset-react
yarn add --dev @testing-library/react @types/jest jest-environment-jsdom
- Opcional: Si usamos Fetch API en el proyecto:
| { | |
| // Place your snippets for typescript here. Each snippet is defined under a snippet name and has a prefix, body and | |
| // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
| // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
| // same ids are connected. | |
| // Example: | |
| // "Print to console": { | |
| // "prefix": "log", | |
| // "body": [ | |
| // "console.log('$1');", |
| import React from 'react'; | |
| import './login.css'; | |
| export const LoginScreen = () => { | |
| return ( | |
| <div className="container login-container"> | |
| <div className="row"> | |
| <div className="col-md-6 login-form-1"> | |
| <h3>Ingreso</h3> | |
| <form> |
| import { createSlice } from '@reduxjs/toolkit'; | |
| export const templateSlice = createSlice({ | |
| name: 'name', | |
| initialState: { | |
| counter: 10 | |
| }, | |
| reducers: { | |
| increment: (state, /* action */ ) => { | |
| //! https://react-redux.js.org/tutorials/quick-start |
Instalar Node Sitio oficial de node
Instalar VSCode Editor Visual Studio Code
Instalar Google Chrome Google Chrome
opcional - Yarn
| const heroes = [ | |
| { | |
| id: 1, | |
| name: 'Batman', | |
| owner: 'DC' | |
| }, | |
| { | |
| id: 2, | |
| name: 'Spiderman', | |
| owner: 'Marvel' |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8" /> | |
| <!-- Cargat React --> | |
| <script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script> | |
| <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script> | |
| <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script> |
| import 'dart:async'; | |
| // Creditos | |
| // https://stackoverflow.com/a/52922130/7834829 | |
| class Debouncer<T> { | |
| Debouncer({ | |
| required this.duration, | |
| this.onValue | |
| }); |