Eliminar espacios en blanco en un array

var arr = [‘Apple’, ‘ ‘, ‘Mango’, ”, ‘Banana’, ‘ ‘, ‘Strawberry’]; // ES6 arr = arr.filter(e => String(e).trim()); // ES5 arr = arr.filter(function(e) { return String(e).trim(); });

Splash screen sin librerias

import React, {useState, useEffect} from ‘react’; // import all the components we are going to use import {View, Text, Image, StyleSheet} from ‘react-native’; const App = (props) => { const [align, setAlign] = useState(‘center’); const [alignsecond, setAlignsecond] = useState(false); useEffect(() => { let myTimeout = setTimeout(() => { setAlign(‘flex-start’), setAlignsecond(true); }, 3000); setTimeout(() => { […]

generate Abb react native

cd android ./gradlew assembleRelease Before uploading the release build to the Play Store, make sure you test it thoroughly. mkdir -p android/app/src/main/assets react-native bundle –platform android –dev false –entry-file index.js –bundle-output android/app/src/main/assets/index.android.bundle –assets-dest android/app/src/main/res react-native run-android –variant=release cd android && ./gradlew bundleRelease -x bundleReleaseJsAndAssets – Your AAB will be present in the folder /android/app/build/outputs/bundle/release

Desabilitar el boton de atras

import React, {Component, useEffect} from ‘react’; import { View, Text, BackHandler, } from ‘react-native’; const LogInView = () => { useEffect(() => { BackHandler.addEventListener(‘hardwareBackPress’, () => true) return () => BackHandler.removeEventListener(‘hardwareBackPress’, () => true) }, []) return ( Back button example ); } export default LoginView

Borrar repetidos en un array

const tempArray = [ { id: 1, name: “Pankaj” }, { id: 2, name: “Nitin” }, { id: 3, name: “Rita” }, { id: 4, name: “Nikita” }, { id: 5, name: “Pankaj” }, { id: 6, name: “Jitender” }, { id: 7, name: “Sonal” }, { id: 8, name: “Sonal” }, { id: 9, […]

Generar la keystore

Para generar la keystore para la tienda o para usarla en firebase nos ubicamos en la carpeta de android y escribe los siguientes comandos  keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000 Obtener el sha1 keytool -exportcert -list -v -alias futura -keystore my-release-key.keystore