This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const episodes = [ | |
{ id: 's06e01', title: 'Pilot' }, | |
{ id: 's06e02', title: 'Top Banana' }, | |
{ id: 's06e03', title: 'Charity Drive' }, | |
{ id: 's06e04', title: 'Visiting Ours' }, | |
{ id: 's06e05', title: 'My Mother, the Car' }, | |
{ id: 's06e06', title: 'In God We Trust' }, | |
{ id: 's06e07', title: 'Storming the castle' }, | |
{ id: 's06e08', title: 'Pier Pressure' }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pokemon = [ | |
{ name: 'pikachu', strength: 5, evolved: false, }, | |
{ name: 'snorlax', strength: 3, evolved: false, }, | |
{ name: 'mewtwo', strength: 2.5, evolved: false, }, | |
{ name: 'onyx', strength: 1.5, evolved: false, }, | |
]; | |
const transformedPokemon = pokemon.map(function (pokemon) { | |
return Object.assign({}, pokemon, { | |
strength: pokemon.strength * 2, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cars = ["honda", "hondai", "dodge", "jeep"] | |
//USING forEach() | |
cars.forEach(function(car){ | |
console.log(car); | |
}) | |
//=> honda | |
//=>hondai | |
//=>dodge | |
//=>jeep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ScrollView, Text, StyleSheet, View, TextInput, ListView } from 'react-native'; | |
export default class App extends React.Component { | |
constructor(){ | |
super(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ScrollView, Text, StyleSheet, View, TextInput } from 'react-native'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<View> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { ScrollView, Text, StyleSheet, View } from 'react-native'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<View style={styles.background}> | |
<ScrollView > | |
{this.props.text.map((item)=> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View, TextInput, Image } from 'react-native'; | |
export default class App extends React.Component { | |
constructor(){ | |
super(); | |
this.state={ | |
text: '' | |
} | |
this.handleClick = this.handleClick.bind(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentWillReceiveProps(nextProps){ | |
console.log('d') | |
if(nextProps !== this.props){ | |
this.setState({ | |
complete: false | |
}) | |
} | |
} | |
shouldComponentUpdate(nextProps, nextState){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class Todo extends React.Component{ | |
constructor(){ | |
super(); | |
this.state={ | |
complete: false | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
class Todo extends React.Component{ | |
constructor(){ | |
super(); | |
this.state={ | |
complete: false | |
} |