Skip to content

Instantly share code, notes, and snippets.

View jm90m's full-sized avatar
🎯

JM Myers jm90m

🎯
  • Burlington, MA
View GitHub Profile
@jm90m
jm90m / data.js
Created July 30, 2017 21:11
expo-netflix-example dummy data file
const DARE_DEVIL = require('../../assets/images/dare-devil.jpeg');
const HOUSE_OF_CARDS = require('../../assets/images/house-of-cards.jpeg');
const LUKE_CAGE = require('../../assets/images/luke-cage.jpeg');
const ORANGE_IS_THE_NEW_BLACK = require('../../assets/images/orange-is-the-new-black.jpeg');
const STRANGER_THINGS = require('../../assets/images/stranger-things.jpeg');
const SHOWS = [
{
title: 'Daredevil',
summary: 'When a young boy vanishes, a small town uncovers a mystery involving a secret experiment, terrify supernatural forces, and one strange little girl',
@jm90m
jm90m / styles.js
Created July 30, 2017 21:03
expo-netflix-example styles.js constants file
export const COLORS = {
GREY: {
BLACK_RUSSIAN: '#0A0A0B',
BRIGHT_GREY: '#5A5B60',
},
RED: {
FIRE_ENGINE_RED: '#D81120',
},
WHITE: {
WHITE: '#FFFFFF',
@jm90m
jm90m / .babelrc
Created July 30, 2017 20:25
Expo NetFlix Tutorial Babel RC
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source",
["module-resolver", {
"root": ["./src"]
}]
]
import React, { Component } from 'react';
import styled, { keyframes } from 'styled-components';
import { COLORS } from 'constants/styles';
const shift = keyframes`
0%{
left: -60px
opacity: 0;
background-color: ${COLORS.YELLOW.YELLOW};
}

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props