title: Reducer always returning initial state React-native
body: <p>I want to use Reducers,redux,thunk. I have a sample code.<br>
  When I starting project, running with no error. I want to change email first letter appears and return the value Initial value.<br>
  I did use these codes with this package.json but when I update all libraries crash some functions. I share finale package.json file at the end of my post.<br>
  package.json file:</p>
  
  <pre><code>{
    "main": "node_modules/expo/AppEntry.js",
    "private": true,
    "dependencies": {
      "expo": "^25.0.0",
      "lodash": "^4.17.4",
      "react": "16.2.0",
      "react-native": "https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz",
      "react-native-router-flux": "^3.40.1",
      "react-redux": "^5.0.6",
      "react-router-native": "^4.2.0",
      "redux": "^3.7.2",
      "redux-thunk": "^2.2.0"
    }
  }
  </code></pre>
  
  <p>Look at my gif please.<br>
  <a href="https://i.stack.imgur.com/ikF1w.gif" rel="nofollow noreferrer">Problem Gif</a></p>
  
  <p>App.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { Provider } from 'react-redux';
  import { createStore, applyMiddleware } from 'redux';
  import ReduxThunk from 'redux-thunk';
  import reducers from './src/reducers';
  import Router from './src/Router';
  
  
  class App extends Component {
    render() {
      const store = createStore(reducers, applyMiddleware(ReduxThunk));
      return (
        &lt;Provider store={store}&gt;
          &lt;Router /&gt;
        &lt;/Provider&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  
  <p>router.js</p>
  
  <pre><code>import React from 'react';
  import {Scene, Router, Stack} from 'react-native-router-flux';
  import Login from './components/Login';
  
  const RouterComponent = () =&gt; {
    return (
      &lt;Router navigationBarStyle={{backgroundColor: 'transparent'}}&gt;
        &lt;Stack key="root"&gt;
            &lt;Scene key="Login" component={Login} title="Giriş Yap" backTitle=" " hideNavBar={true} type="reset" initial/&gt;
        &lt;/Stack&gt;
      &lt;/Router&gt;
  
    );
  };
  
  export default RouterComponent;
  </code></pre>
  
  <p>This is my Login.js
  I want to change email or password in textinput return initial value</p>
  
  <pre><code>import React, { Component } from 'react';
  import { TextInput, View } from 'react-native';
  import { Actions } from 'react-native-router-flux';
  import { connect } from 'react-redux';
  import { emailChanged, passwordChanged, loginUser } from '../actions';
  import { KucukButton } from '../ortak';
  
  class Login extends Component {
    state ={ email: '', password: '', loading: false };
  
  clickLogin() {
    const { email, password } = this.props;
    this.props.loginUser({ email, password });
  }
  
  loginSucces() {
    console.log('başarılı');
    this.setState({ loading: false });
  }
  
  
  loginFail() {
    console.log('Hatalı');
    this.setState({ loading: false });
    Alert.alert(
      'Mesaj',
      'Kullanıcı adı veya şifreniz hatalı!',
      [
        { text: 'Tamam', onPress: () =&gt; null }
      ]
    );
  }
    render() {
      return (
         &lt;View
          style={{
            justifyContent: 'center',
            flex: 1
          }}&gt;
              &lt;TextInput
                autoCapitalize="none"
                keyboardType="email-address"
                placeholder="örn hesap: test@test.com"
                placeholderTextColor="#000"
                value={this.props.email}
                onChangeText={email =&gt; this.props.emailChanged(email)}
              /&gt;
              &lt;KucukButton yazisiz="hayir" onPress={this.clickLogin.bind(this)}&gt; Giriş Yap &lt;/KucukButton&gt;
        &lt;/View&gt;
      );
    }
  }
  const mapStateToProps = ({ kimlikdogrulamaResponse }) =&gt; {
    const {email, password }= kimlikdogrulamaResponse;
    return {
      email,
      password
    };
  };
  
  export default connect(mapStateToProps, { emailChanged, passwordChanged, loginUser })(Login);
  </code></pre>
  
  <p>and this is my actions.js</p>
  
  <pre><code>import { EMAIL_CHANGED, PASSWORD_CHANGED } from './types';
  
  export const emailChanged = (email) =&gt; {
    return (dispatch) =&gt; {
      dispatch({
        type: EMAIL_CHANGED,
        payload: email
      });
    };
  };
  
  
  export const passwordChanged = (password) =&gt; {
    return (dispatch) =&gt; {
      dispatch({
        type: PASSWORD_CHANGED,
        payload: password
      });
    };
  };
  </code></pre>
  
  <p>types.js</p>
  
  <pre><code>export const EMAIL_CHANGED = 'email_changed';
  export const PASSWORD_CHANGED = 'password_changed';
  </code></pre>
  
  <p>Reducers.js</p>
  
  <pre><code>import { EMAIL_CHANGED, PASSWORD_CHANGED } from '../actions/types';
  
  const INITIAL_STATE = {
    email: '00000000',
    password: ''
  };
  
  export default (state = INITIAL_STATE, action) =&gt; {
    switch (action.type) {
      case EMAIL_CHANGED:
          return { ...state, email: action.payload };
      case PASSWORD_CHANGED:
        return { ...state, password: action.payload };
    default:
        return state;
  
    }
  };
  </code></pre>
  
  <p>finally my package.json file:</p>
  
  <pre><code>{
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
      "start": "expo start",
      "android": "expo start --android",
      "ios": "expo start --ios",
      "eject": "expo eject"
    },
    "dependencies": {
      "expo": "^31.0.2",
      "firebase": "^5.7.2",
      "lodash": "^4.17.11",
      "react": "16.5.0",
      "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz",
      "react-native-router-flux": "^4.0.6",
      "react-redux": "^6.0.0",
      "react-router-native": "^4.3.0",
      "redux": "^4.0.1",
      "redux-thunk": "^2.3.0"
    },
    "devDependencies": {
      "babel-preset-expo": "^5.0.0"
    },
    "private": true
  }
  </code></pre>
  
  <p>EDIT::
  you can look my snack for testing.
  <a href="https://snack.expo.io/@wyrustaaruz/aGFzYW" rel="nofollow noreferrer">Snack Expo Application</a></p>