Skip to content

Instantly share code, notes, and snippets.

View callmephilip's full-sized avatar

Philip Nuzhnyi callmephilip

View GitHub Profile
git clone https://github.com/thebakeryio/todomvc-react-native.git
cd todomvc-react-native && npm install
npm run ios
npm run android
import globalNavigation from './components/GlobalNavigation/reducer';
import tabs from './components/ApplicationTabs/reducer';
import feed from './components/Feed/reducer';
import { combineReducers } from 'redux-immutable';
const scopeNavigationReducer = (reducer, scopeName) => {
return (state, action) => {
if (action.scope && action.scope !== scopeName) {
return state;
} else {
import ReactNative from 'react-native';
const { NavigationExperimental } = ReactNative;
const { Reducer: NavigationReducer } = NavigationExperimental;
const feedNavigation = NavigationReducer.StackReducer({
getPushedReducerForAction: (action) => {
if (action.type === 'push') {
return (state) => (state || action.route);
}
return null;
export default connect(mapStateToProps, mapDispatchToProps, (stateProps, dispatchProps, ownProps) => {
return Object.assign({}, ownProps, stateProps, dispatchProps, {
onNavigate: (action) => {
dispatchProps.dispatch(Object.assign(action, {
scope: action.scope || stateProps.navigation.key
}));
}
});
})(Feed);
import { View, NavigationExperimental } from 'react-native';
import React, { Component } from 'react';
import styles from './styles';
import { connect } from 'react-redux';
import Items from '../Items';
import ItemDetails from '../ItemDetails';
const { CardStack: NavigationCardStack } = NavigationExperimental;
class Feed extends Component {
import ReactNative from 'react-native';
const { NavigationExperimental } = ReactNative;
const { Reducer: NavigationReducer } = NavigationExperimental;
const feedNavigation = NavigationReducer.StackReducer({
getPushedReducerForAction: (action) => {
if (action.type === 'push') {
return (state) => (state || action.route);
}
return null;
import globalNavigation from './components/GlobalNavigation/reducer';
import tabs from './components/ApplicationTabs/reducer';
import feed from './components/Feed/reducer';
import { combineReducers } from 'redux-immutable';
const applicationReducers = {
globalNavigation,
tabs,
feed
};
/*
*
* GlobalNavigation
*
*/
import { View, NavigationExperimental } from 'react-native';
import React, { Component } from 'react';
import styles from './styles';
import { connect } from 'react-redux';
/*
*
* GlobalNavigation reducer
*
*/
import ReactNative from 'react-native';
const { NavigationExperimental } = ReactNative;
const { Reducer: NavigationReducer } = NavigationExperimental;
import React, { Component } from 'react';
import { TabBarIOS, NavigationExperimental } from 'react-native';
import Feed from '../Feed';
import { connect } from 'react-redux';
const { Reducer: NavigationReducer } = NavigationExperimental;
const { JumpToAction } = NavigationReducer.TabsReducer;
class ApplicationTabs extends Component {
_renderTabContent(tab) {