Inteligencia Futura

React Native Hello World

Explicación del código.(Explanation of the code)

  • importamos los componentes que necesitamos mediante el uso de import(we import the components we need by using import)
  • usamos useState que es mas organizado y recomendado(we use useState which is more organized and recommended).
  • almacenamos todo en una constante llamada App(we store everything in a constant called App).
  • const[count, setCount] = useState(0); traduce lo siguiente: el primer valor es la variable y el segundo valor corresponde a la función o método, useState(0) es el valor por defecto que asignamos, podemos asignar desde un boolean hasta un array vacío [] (const [count, setCount] = useState (0); translates the following: the first value is the variable and the second value corresponds to the function or method, useState (0) is the default value we assign, we can assign from a boolean or an empty array [])

import React, { useState } from ‘react’;
import { View, Text, Button, StyleSheet } from ‘react-native’;

const App = () => {
const [count, setCount] = useState(0);

return (
<View style={styles.container}>
<Text>You clicked {count} times</Text>
<Button
onPress={() => setCount(count + 1)}
title="Click me!"
/>
</View>
);
};

// React Native Styles
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: ‘center’,
alignItems: ‘center’
}
});

FlatList dinámica(Dynamic FlatList)

import React from ‘react’; import { StyleSheet, Text, View, FlatList, Image, TouchableOpacity } from ‘react-native’; function Item({ item }) { return ( <View style={styles.listItem}> <Image

Read More »
Email:

inteligenciafuturatv@gmail.com

Empresa
(Business)

Links

Últimas noticias(Latest News)

Copyright © 2021. Designed by  Inteligencia Futura