- Create a project in XCode with the default settings
- iOS > Application > Single View Application
- Language: Swift
- Under project General settings, add ReactKit to Linked Framework and Libraries
- + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
- Now ReactKit would have been imported. Link it by choosing it from the list.
- + > lib.ReactKit.a
- Under project Build Settings,
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.cards.notification"> | |
<uses-sdk | |
android:minSdkVersion="17" | |
android:targetSdkVersion="17" /> | |
<application | |
android:allowBackup="true" |
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, { | |
Component, | |
PropTypes | |
} from 'react'; | |
import shallowCompare from 'react-addons-shallow-compare'; | |
class TextInput extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { stateValue: '' }; |
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 { | |
getLocationOrigin | |
} from '../fetchTools'; | |
const BASE_URL = getLocationOrigin(); | |
export const promisedHttpRequest = (endpoint, options, onProgressCallback) => { | |
request('GET', `${BASE_URL}/${endpoint}`, options, onProgressCallback); | |
}; |
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, { Component } from 'react'; | |
import { Motion, spring } from 'react-motion'; | |
const styles = { | |
container: { | |
borderRadius: '4px', | |
backgroundColor: 'rgb(240, 240, 232)', | |
position: 'relative', | |
margin: '5px 3px 10px', | |
width: '450px', |
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, { Component } from 'react'; | |
import { | |
AppRegistry, | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity | |
} from 'react-native'; | |
import { Motion, spring } from 'react-motion'; |
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
// ReactJS: | |
<Motion style={{x: spring(this.state.open ? 400 : 0)}}> | |
{({x}) => | |
<div style={styles.container}> | |
<div | |
style={ | |
{ | |
...styles.movingCube, | |
WebkitTransform: `translate3d(${x}px, 0, 0)`, | |
transform: `translate3d(${x}px, 0, 0)` |