- 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:
| // Instalar react-navigation/native | |
| npm install @react-navigation/native | |
| // Instalar las dependencias | |
| npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view | |
| // Instalar navegación en Stack | |
| npm i @react-navigation/stack |
| const stat = require('fs').statSync; | |
| const AdmZip = require('adm-zip'); | |
| /** | |
| * Example usage | |
| */ | |
| newArchive(`test-${+new Date}.zip`, [ | |
| 'index.js', | |
| 'package.json', | |
| 'node_modules' |
| {{-- You do not need to add this component if you are using the permanent option in the head component --}} | |
| <script> | |
| if (!window.sessionTimerPermanent && window.Livewire) { | |
| window.livewire.hook('afterDomUpdate', startSessionTimer) | |
| } | |
| // if you are on livewire > 1.3.1 and want to avoid the default error alert | |
| // https://github.com/livewire/livewire/pull/1146 | |
| window.livewire.onError(statusCode => { | |
| if (statusCode === 419) { |
| import React, {useState} from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { Editor } from '@tinymce/tinymce-react'; | |
| const BlogForm = (props) => { | |
| const blogTypes = JSON.parse(props.blogTypes); | |
| const categories = JSON.parse(props.categories); |
| import Reader from './Reader'; | |
| import Target from './Target'; | |
| /** | |
| * This is default annotation property for automatic type casting: | |
| * <code> | |
| * @Annotation({ some: any }) | |
| * // => will be casts "as is" {some: any} | |
| * | |
| * @Annotation("any") |
| protected function apiAs($user, $method, $uri, array $data = [], array $headers = []) | |
| { | |
| $headers = array_merge([ | |
| 'Authorization' => 'Bearer '.\JWTAuth::fromUser($user), | |
| ], $headers); | |
| return $this->api($method, $uri, $data, $headers); | |
| } | |
| import React from 'react' | |
| import axios, { post } from 'axios'; | |
| class SimpleReactFileUpload extends React.Component { | |
| constructor(props) { | |
| super(props); | |
| this.state ={ | |
| file:null | |
| } |