Skip to content

Instantly share code, notes, and snippets.

@lrlineroa
lrlineroa / Square.js
Last active June 29, 2019 06:19
Gist 3 webinario Fundamentos de React Codibus
import React from 'react';
import { Button,Text } from 'react-native';
function Square(props) {
return (
<Button onPress={props.onClick} title={""+props.value} />
);
}
export default Square;
import React from 'react';
//cambiar Button por TouchableOpacity
// |
// |
// V
import { TouchableOpacity,Text } from 'react-native';
function Square(props) {
return (
//Borrar
<Button onPress={props.onClick} title={""+props.value} />
import React from 'react';
import Square from './Square';
import { View, Text } from 'react-native';
class Board extends React.Component {
constructor(props) {
super(props);
this.state = {
squares: Array(9).fill(null),
xIsNext: true,
import React from 'react';
import Square from './Square';
// Se Agrega StyleSheet
// |
// |
// V
import { View, Text, StyleSheet } from 'react-native';
class Board extends React.Component {
constructor(props) {
import React from 'react';
import Square from './Square';
import { View, Text, StyleSheet,Button } from 'react-native';
class Board extends React.Component {
constructor(props) {
super(props);
this.state = {
squares: Array(9).fill(null),
xIsNext: true,
//Hagamos una cosa,
//Si vas a ver la solución puede ser por 2 cosas
//1. acabaste la tarea y quieres verificar
//2. No la has acabado, y estás estancado (aunque por lo visto muy rápido)
//3.(Mi Favorita) Eres un estudioso de soluciones, y quieres estudiar a profundidad la solución,
//por si algun dia se te presentan retos más grandes
var solucion='...'
console.log('La solución está en :'+solucion)
import React from 'react';
// Se Agrega StyleSheet
// |
// |
// V
import { TouchableOpacity,Text,StyleSheet } from 'react-native';
function Square(props) {
return (
// Primera manera de poner estilo, Objeto externo
// |
import React, { Component } from 'react';
import { View,Text } from 'react-native';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = { }
}
render() {
return ( <View>
<Text>
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
//se añade este import
// |
// |
// V
import AddACard from './src/components/UI/AddACard';
export default function App() {
return (
import React, { Component } from 'react';
import { View, Text } from 'react-native';
import { Card, CardItem, Button, Item, Label, Input } from 'native-base';
class AddACard extends Component {
constructor(props) {
super(props);
this.state = {}
}
render() {