Skip to content

Instantly share code, notes, and snippets.

View rocksinghajay's full-sized avatar

Ajay singh rocksinghajay

View GitHub Profile
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb451477895645216</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
import React from 'react'
import { View, Text, Button } from 'react-native'
import { connect } from 'react-redux'
class DetailsScreen extends React.Component {
render() {
const { dummyReducer = {} } = this.props
const { text = ''} = dummyReducer
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
import React from 'react'
import { View, Text, Button } from 'react-native'
import { connect } from 'react-redux'
import { dummyAction } from '../actions/dummyAction'
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
import { createAppContainer, createStackNavigator } from 'react-navigation'
import HomeScreen from './components/HomeScreen'
import DetailsScreen from './components/DetailsScreen'
const AppNavigator = createStackNavigator({
Home: {
screen: HomeScreen,
},
Details: {
screen: DetailsScreen,
import SET_TEXT from '../types/types'
const initialState = {
text: '',
}
const dummyReducer = (state = initialState, action = {}) => {
switch(action.type) {
case SET_TEXT:
import { SET_TEXT } from '../types/types'
export const dummyAction = (data) => {
return {
types: SET_TEXT,
payload: {
data
}
}
}
export const SET_TEXT = 'SET_TEXT'
import React from 'react'
import { Provider } from 'react-redux'
import Router from './Router'
import store from './store'
class App extends React.Component {
render() {
return (
<Provider store={store}>
import { createStore, combineReducers, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
import dummyReducers from './reducers/dummyReducer'
const reducer = combineReducers ({ dummyReducers })
const store = createStore(
reducer,
applyMiddleware(thunk)
import React from 'react'
import { View, Text, Button } from 'react-native'
import { createAppContainer, createStackNavigator } from 'react-navigation'
class HomeScreen extends React.Component {
render() {
return (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text>Home Screen</Text>
<Button