Coder Social home page Coder Social logo

react-native-diary's Introduction

react-native-diary's People

Contributors

lintonye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

react-native-diary's Issues

First tap not working on custom transition

Hi lintonye,

thank you for your guides and your code.

I've tried to take your CrossFadeTransitioner and use that as my default transition.

this is my router:

import { StackRouter } from 'react-navigation';

import MainScreen from './containers/MainScreen';
import DetailScreen from './containers/DetailScreen';

export default AppRouter = StackRouter({
  Main: { screen: MainScreen },
  Detail: { screen: DetailScreen }
});

this is my reducers:

import AppRouter from './router';

const initialNavState = {
  index: 0,
  routes: [
    { key: 'main', routeName: 'Main' },
    { key: 'detail', routeName: 'Detail' },
  ],
};

const navReducer = (state = initialNavState, action) => {
  const newState = AppRouter.getStateForAction(action, state);
  return newState || state;
};

export default function createReducer() {
  return combineReducers({
    nav: navReducer,
    main: mainScreenReducer,
  });
}

my navigator:

import CrossFadeTrasitioner from './transitioners/CrossFadeTrasitioner';
import AppRouter from './router';

export const AppNavigator = createNavigator(AppRouter)(CrossFadeTrasitioner);

const AppWithNavigationState = connect(state => ({
  nav: state.nav,
}))(({ dispatch, nav }) => (
  <AppNavigator navigation={addNavigationHelpers({ dispatch, state: nav })} />
));

export default AppWithNavigationState;

now when my component Main appear i can't tap anything! so on componentDidMount i've tried to change location after 2 seconds, app goes into Detail and then i can go back and tap anywhere.

Have you any idea of this?

my MainScreen component:

export class MainScreen extends Component {

  componentDidMount() {
    const { navigation } = this.props;
    setTimeout(() => {
      navigation.navigate('Detail');
    }, 5000);
  }

  handleItemTap = () => {
    const { navigation } = this.props;
    navigation.navigate('Detail');
  }

  render() {
    return (
      <View style={{flex: 1}}>
        <TouchableHighlight onPress={this.handleItemTap} style={{flex: 1}}>
          <View style={{flex: 1}}>
            <View style={{position: 'relative', backgroundColor: 'blue', flex: 0.3}} />
            <View style={{backgroundColor: 'red', flex: 0.5, width: 200, alignSelf: 'center'}}>
              <Text> LIST </Text>
            </View>
          </View>
        </TouchableHighlight>
      </View>
    );
  }
}

Thank you in advice.

Lorenzo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.