Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in App.js file. As 'login' and 'actions' are imported & It has not used. #1

Open
maharshioza opened this issue Jan 7, 2016 · 0 comments

Comments

@maharshioza
Copy link

I am using React-Redux starter kit & trying to implement only Login Authentication.
In the App page: I am getting error. 'login' defined but never used & same error for 'loginUser' action.

Even I am getting error:
Uncaught TypeError: Cannot read property 'isAuthenticated' of undefined

This is my code:

import React, { Component, PropTypes } from 'react'
import { connect } from 'react-redux'
import Navbar from './Navbar'
import Login from './Login'
import { loginUser } from './redux/module/action'

class App extends Component {
render () {
const { dispatch, isAuthenticated, errorMessage } = this.props
return (




)
}
}

App.propTypes = {
dispatch: PropTypes.func.isRequired,
isAuthenticated: PropTypes.bool.isRequired,
errorMessage: PropTypes.string
}

function mapStateToProps (state) {
const{ auth } = state
const { isAuthenticated, errorMessage } = auth

return {
isAuthenticated,
errorMessage
}
}

export default connect(mapStateToProps)(App)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant