Skip to content

Instantly share code, notes, and snippets.

import {StyleSheet} from 'react-native'
const styles = StyleSheet.create({
rowContainer: {
flexDirection: this.props.reverseRow ? 'row-reverse' : 'row,
}
})
@dk0r
dk0r / 0_Parent.js
Last active September 13, 2017 16:52
undefined is not an object (evaluating 'this.props.event.location')
import Child from './Child'
let newEvent = {
location: { latitude: 42.816006, longitude: -73.911287},
color: 'wheat'
}
export default class Parent extends React.Component {
render() {
D:\workspace\BWP (master)
λ git status
On branch master
Your branch and 'origin/master' have diverged,
and have 2 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
You are currently rebasing branch 'master' on '0b71b84'.
(all conflicts fixed: run "git rebase --continue")
@dk0r
dk0r / test.jsx
Created August 29, 2017 19:10
Attempting to capture responder-lock from a child on line-13/14
export default class Schedule extends Component {
constructor(props) {
super(props)
const position = new Animated.ValueXY()
const panResponder = PanResponder.create({
//Ask to be the responder:
onStartShouldSetPanResponder: () => true,
@dk0r
dk0r / colors.js
Last active August 29, 2017 02:05
export default {
background: '#ffffff',
primaryText: '#525252',
subtleText: '#9a9a9a',
rowUnderlay: 'rgba(154, 154, 154, 0.25)',
borderColor: '#cccccc',
grayBackground: '#f9fafb',
link: '#007aff',
yellow(a): `rgba(255,196,35,${a})`
}
@dk0r
dk0r / 0_Router.js
Last active August 28, 2017 18:23
Receiving error that `this.props.drawer` is undefined: http://i.imgur.com/uEtsvEH.png
import { TabNavigator } from 'react-navigation'
export const Tabs = TabNavigator(
{
Home: {
screen: Container,
navigationOptions: {
tabBarLabel: 'Home',
tabBarIcon: ({ tintColor }) =>
<Icon name="ios-home" size={28} color={tintColor} />
export default class DrawerContainer extends Component {
render() {
drawerCheck = () => {
this.drawer
? this.drawer.openDrawer()
: alert('this.drawer is Undefined!')
}
return (
class LoggedInWrap extends Component {
state = {
route: {
routeName: "Home",
},
};
openDrawer = () => {
this.drawer.openDrawer();
};
import DrawerLayout from 'react-native-drawer-layout'
import NavigationView from './NavigationView.js'
export default class DrawerContainer extends React.Component {
render() {
return (
<DrawerLayout
drawerWidth={300}
drawerPosition={DrawerLayout.positions.Left}
renderNavigationView={() => NavigationView}
@dk0r
dk0r / Drawer.jsx
Last active August 25, 2017 18:17
Line-30's onPress() produces error: undefined is not an object (evaluating '_this2.drawer.openDrawer')
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native'
import DrawerLayout from 'react-native-drawer-layout'
export default class Drawer extends Component {
constructor(props) {
super(props)
this.state = {}