Skip to content

Instantly share code, notes, and snippets.

@reactnative
reactnative / MovieCell.js
Last active August 29, 2015 14:14
ReactJSConf snippets
//[...]
var getImageSource = require('./getImageSource');
var MovieCell = React.createClass({
render: function() {
return (
<View>
<TouchableHighlight onPress={this.props.onselect}>
<View style={styles.row}>
<Image
@reactnative
reactnative / react-native-sqlite.js
Created April 4, 2015 08:00
react-native-sqlite
var sqlite = require('./react-native-sqlite');
sqlite.open("filename.sqlite", function (error, database) {
if (error) {
console.log("Failed to open database:", error);
return;
}
var sql = "SELECT a, b FROM table WHERE field=? AND otherfield=?";
var params = ["somestring", 99];
database.executeSQL(sql, params, rowCallback, completeCallback);
function rowCallback(rowData) {