title: Redux Can't Get State from Store
body: <p>Edit: I am actually stuck here, can't solve it on my own and  a simple fix to code would help a lot.</p>
  
  <p>I am currently working on a project and need to use redux-store , i try to pass value prop from app.js to AppRouter.js but when i try to access 'value' prop by logging it to console or rendering it ; i am getting undefined error both on console log and inside render value : . How can i overcome this? Any helps appreciated.</p>
  
  <p>Here is my app.js </p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import {AppRouter} from './routers/AppRouter.js';
  import {Provider} from 'react-redux';
  import {createStore} from 'redux';
  
  
  const initialState = {
      login: true,
      value: "10"
    };
  
  const reducer = (state = initialState, action) =&gt; {
      if(action.type === "loginTrue") {
        return {
          login: true,
          value: "10"
        };
      }
  
      else{
          return {
          login: true,
          value: "10"
        };
  
      }
      return state;
  };
  
  
  
  const store = createStore(reducer,initialState);
  
  store.dispatch({type: "loginTrue"});
  
  
  const jsx = (
      &lt;Provider store={store}&gt;
      &lt;AppRouter/&gt;
      &lt;/Provider&gt;
  );
  
  ReactDOM.render(jsx,document.getElementById('app'));
  </code></pre>
  
  <p>Here is my AppRouter</p>
  
  <pre><code>import {Router, Route, Switch} from 'react-router-dom';
  import React from 'react';
  import {DashBoard} from '../components/DashBoard.js';
  import {Login} from '../components/Login.js';
  import {SignUp} from '../components/SignUp.js';
  import {NotFoundPage} from '../components/NotFoundPage.js';
  import {Header} from '../components/Header.js';
  import {LoginSuccess} from '../components/LoginSuccess';
  import {Failed} from '../components/Failed';
  import createHistory from 'history/createBrowserHistory';
  import {connect} from 'react-redux';
  
  export const history = createHistory();
  
  export class AppRouter extends React.Component {
      constructor(props){
          super(props);
      }
  
      render() {
          console.log("val "+ this.props.value);  //output val undefined
        return(
  
      &lt;Router history={history}&gt;
      &lt;div&gt;
          &lt;Header /&gt;
          value: {this.props.value}                //outputs value : 
      &lt;Switch&gt;
          &lt;Route path="/" component={DashBoard} exact={true}/&gt;
          &lt;Route path="/login" component = {Login} /&gt;
          &lt;Route path="/signup" component = {SignUp}/&gt;
          &lt;Route path="/loginSuccess" component = {LoginSuccess}/&gt;
          &lt;Route path="/failed" component = {Failed}/&gt;
          &lt;Route component = {NotFoundPage} /&gt;
  
      &lt;/Switch&gt;
       &lt;/div&gt;
      &lt;/Router&gt;
      )
    }
  
  };
  
  const mapStateToProps = (state) =&gt;{
      return {
          value: state.value
      };
  };
  
  export default connect(mapStateToProps)(AppRouter);
  </code></pre>