Skip to content

Instantly share code, notes, and snippets.

View chuyihuang's full-sized avatar

Bamboo Huang chuyihuang

View GitHub Profile
@chuyihuang
chuyihuang / App.js
Created August 29, 2017 09:02
week_3_demo_3
import React, { Component } from 'react';
import { View, TextInput, Text, Button } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
value: null,
todos: [],
}
@chuyihuang
chuyihuang / App.js
Last active August 29, 2017 09:00
week_3_demo_2
import React, { Component } from 'react';
import { View, TextInput, Text, Button } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
value: null,
todos: [],
}
@chuyihuang
chuyihuang / App.js
Created August 29, 2017 08:12
week_3_demo_1
import React, { Component } from 'react';
import { View, TextInput, Text, Button } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
value: null
}
}
@chuyihuang
chuyihuang / week_2_demo_7.js
Created August 13, 2017 16:35
React Native workshop #2 snippet
import React, { Component } from 'react';
import { View, TextInput, Text } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
value: null
}
}
@chuyihuang
chuyihuang / week_2_demo_6.js
Created August 13, 2017 16:23
React Native workshop #2 snippet
import React, { Component } from 'react';
import { View, TextInput } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
value: null
}
}
componentWillReceiveProps() {
@chuyihuang
chuyihuang / week_2_demo_5.js
Last active August 13, 2017 16:14
React Native workshop #2 snippet
import React, { Component } from 'react';
import { View, TextInput } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
console.log("constructor");
}
componentWillMount() {
console.log("component will mount");
}
@chuyihuang
chuyihuang / week_2_demo_4.js
Created August 13, 2017 06:50
React Native workshop #2 snippet
<View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
<Text style={
{
color: '#cc0000',
fontSize: 40,
textDecorationLine: 'underline',
textDecorationColor: 'blue',
textShadowColor: 'black',
textShadowOffset: {
width: 2,
@chuyihuang
chuyihuang / week_2_demo_3.js
Created August 13, 2017 06:36
React Native workshop 2 snippet
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<View style={{flex: 1, flexDirection: 'column'}}>
<View style={{flex: 1,
@chuyihuang
chuyihuang / week_2_demo_2.js
Created August 13, 2017 04:32
React Native workshop week 2 snippet
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
this.state = {
factor1: 2,
factor2: 5,
}
}
@chuyihuang
chuyihuang / week_2_demo_1.js
Created August 13, 2017 03:37
React Native workshop #2 snippet
import React, { Component } from 'react';
import { Text, View } from 'react-native';
export default class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<Child value="我是子元素" />
);