Skip to content

Instantly share code, notes, and snippets.

View HigoRibeiro's full-sized avatar
🎯
Focusing

Higo Ribeiro HigoRibeiro

🎯
Focusing
View GitHub Profile
/* Core */
import SagaTester from 'redux-saga-tester';
import MockAdapter from 'axios-mock-adapter';
/* redux */
import configureStore from 'redux-mock-store';
import rootSaga from 'store/sagas';
import api from 'services/api';
/* Core */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/* Redux */
import { connect } from 'react-redux';
import UserActions from 'store/ducks/user';
/* Presentational */
import { View, Button, TextInput } from 'react-native';
/* Core */
import React, { Component } from 'react';
import PropTypes from 'prop-types';
/* Redux */
import { connect } from 'react-redux';
import UserActions from 'store/ducks/user';
/* Presentational */
import { View, TextInput } from 'react-native';
import React from 'react';
import { Provider } from 'react-redux';
import 'config/DevToolsConfig';
import 'config/ReactotronConfig';
import Routes from 'routes';
import { PersistGate } from 'redux-persist/lib/integration/react';
import { store, persistor } from 'store';
import React, { Component } from 'react';
import { View, Button, Text } from 'react-native';
import { createStackNavigator } from 'react-navigation';
const Page1 = ({ navigation }) => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home ;D</Text>
<Button title={() => { navigation.navigate('About'); }} />
</View>
);
// src/Page1.js
import React from 'react';
import { View, Button, Text } from 'react-native';
const Page1 = ({ navigation }) => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>Home ;D</Text>
<Button
title="Ir para About"
// src/Page2.js
import React from 'react';
import { View, Button, Text } from 'react-native';
const Page2 = () => (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text>About</Text>
</View>
);
// index.js
import { AppRegistry } from 'react-native';
import Navigator from './src';
const App = Navigator.StackNavigator; // Descomente para usar o StackNavigator.
// const App = Navigator.TabNavigator; // Descomente para usar o TabNavigator.
// const App = Navigator.DrawerNavigator; // Descomente para usar o DrawerNavigator.
AppRegistry.registerComponent('navegacao', () => App);
// src/index.js
import Page1 from './Page1';
import Page2 from './Page2';
import { createStackNavigator } from 'react-navigation';
const StackNavigator = createStackNavigator({
Home: Page1,
About: Page2,
// src/index.js
import Page1 from './Page1';
import Page2 from './Page2';
import { createBottomTabNavigator } from 'react-navigation';
const TabNavigator = createBottomTabNavigator({
Home: Page1,
About: Page2,