- 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:
| <?xml version="1.0" encoding="utf-8"?> | |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:tools="http://schemas.android.com/tools" | |
| package="com.example.android"> | |
| ... | |
| <application | |
| android:icon="@mipmap/ic_launcher" | |
| android:label="@string/app_name"> |
| .pvtUi { | |
| color: #333 | |
| } | |
| table.pvtTable { | |
| font-family:arial; | |
| font-size: 8pt; | |
| text-align: left; | |
| border-collapse: collapse; | |
| } |
| const Container = glamorous.div({ | |
| fontSize: "12pt", | |
| margin: "25px auto", | |
| padding: "5px" | |
| }) | |
| const Header = glamorous.h1({ | |
| fontSize: "24pt", | |
| fontWeight: "bold" | |
| }) |
| <style scoped> | |
| .example { | |
| color: red; | |
| } | |
| </style> |
| <anchored-heading :level="1"> | |
| <span>Hello</span> world! | |
| </anchored-heading> |
| createElement( | |
| 'anchored-heading', { | |
| props: { | |
| level: 1 | |
| } | |
| }, [ | |
| createElement('span', 'Hello'), | |
| ' world!' | |
| ] | |
| ) |
| var React = require('react') | |
| var ReactDOM = require('react-dom') | |
| ReactDOM.render( | |
| <h1>!Que hay de nuevo amigo !</h1>, | |
| document.getElementById('mensaje') | |
| ) |
| { | |
| "name": "clase1", | |
| "version": "0.0.1", | |
| "description": "Ejemplo de dependicia de paquetes en npm", | |
| "main": "main.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "keywords": [ | |
| "react", |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Tutorial de React</title> | |
| </head> | |
| <body> | |
| <div id='mensaje'></div> | |
| <script type="text/javascript" src="bundle.js"></script> | |
| </body> |