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 |
This file contains 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 styled, { keyframes } from 'styled-components'; | |
import { COLORS } from 'constants/styles'; | |
const shift = keyframes` | |
0%{ | |
left: -60px | |
opacity: 0; | |
background-color: ${COLORS.YELLOW.YELLOW}; | |
} |
This file contains 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
Show hidden characters
{ | |
"presets": ["babel-preset-expo"], | |
"env": { | |
"development": { | |
"plugins": [ | |
"transform-react-jsx-source", | |
["module-resolver", { | |
"root": ["./src"] | |
}] | |
] |
This file contains 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
export const COLORS = { | |
GREY: { | |
BLACK_RUSSIAN: '#0A0A0B', | |
BRIGHT_GREY: '#5A5B60', | |
}, | |
RED: { | |
FIRE_ENGINE_RED: '#D81120', | |
}, | |
WHITE: { | |
WHITE: '#FFFFFF', |
This file contains 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
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', |
This file contains 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 PropTypes from 'prop-types'; | |
import styled from 'styled-components/native'; | |
import Icon from 'react-native-vector-icons/FontAwesome'; | |
import { COLORS } from 'constants/styles'; | |
import { TouchableWithoutFeedback } from 'react-native'; | |
const NETFLIX_LOGO = require('../../../assets/icons/netflix-logo.png'); | |
const Container = styled.View` | |
display: flex; |
This file contains 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 { TouchableOpacity } from 'react-native'; | |
import styled from 'styled-components/native'; | |
import { COLORS } from 'constants/styles'; | |
import Icon from 'react-native-vector-icons/FontAwesome'; | |
const Container = styled.View` | |
background-color: ${COLORS.GREY.BLACK_RUSSIAN}; | |
height: 100%; | |
`; |
This file contains 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 styled from 'styled-components/native'; | |
import Header from 'components/common/header'; | |
import { COLORS } from 'constants/styles'; | |
import { TouchableWithoutFeedback, ScrollView, TouchableOpacity } from 'react-native'; | |
import ShowData from 'data/data'; | |
import Icon from 'react-native-vector-icons/FontAwesome'; | |
const Container = styled.View` | |
display: flex; |
This file contains 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 from 'react'; | |
import { StatusBar } from 'react-native'; | |
import { DrawerNavigator, DrawerItems } from 'react-navigation'; | |
import HomeStackNavigator from 'components/navigation/home-stack-navigator'; | |
import { COLORS } from 'constants/styles'; | |
import styled from 'styled-components/native'; | |
const DrawerContainer = styled.View` | |
flex: 1; | |
background-color: ${COLORS.GREY.BRIGHT_GREY}; |
OlderNewer