this.props.dispatch is not a function in react with redux
up vote
0
down vote
favorite
I am calling api with redux action, so i created the reducers, action and store. But when i calling the redux action from the view part. I am getting the following error.
this.props.dispatch is not a function
Below is my reducer, actions and view part(React) Code which can help you to understand the code.
Note: when i console.log(this.props), I am not getting dispatch() function.
actions.js
import {
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from './actionTypes'
export function fetchFeaturedWork(){
return dispatch => {
return fetch("https://api.com/api/wp-json/customapi/all_posts?category=work&featured=true")
.then(res => res.json())
.then(json => {
dispatch(fetchFeaturedWorkSuccess(json.works));
return json.works;
})
};
}
export const fetchFeaturedWorkSuccess = works => ({
type: FETCH_WORKS_SUCCESS,
payload: { works }
});
reducer.js
import {
OPEN_MENU,
CLOSE_MENU,
SET_DEVICE_TYPE,
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from '../actions/actionTypes'
const initialState = {
isMenuOpen: null,
isMobile: false,
error:null,
works:
}
const reducer = (state = initialState, action) => {
switch (action.type) {
case OPEN_MENU:
return {...state, isMenuOpen: true}
case CLOSE_MENU:
return {...state, isMenuOpen: false}
case SET_DEVICE_TYPE:
return {...state, isMobile: action.isMobile}
case FETCH_WORKS_SUCCESS:
return {...state,works:action.payload.works}
case FETCH_WORKS_FAILURE:
return {...state,error:action.payload.error,works:}
default:
return state
}
}
export default reducer;
store.js
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './reducers/reducer';
import thunk from "redux-thunk";
let store = createStore(rootReducer,applyMiddleware(thunk))
export default store
App.js
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Slider from "react-slick";
import Footer from '../footer'
import './index.css';
import { connect } from 'react-redux'
import { openMenu,fetchFeaturedWork } from '../../actions/actionCreators'
import Header from '../header'
import arrowRight from '../../images/arrow-right.svg'
import arrowLeft from '../../images/arrow-left.svg'
const mapStateToProps = (state) => ({
isMobile: state && state.isMobile
})
const mapDispatchToProps = (dispatch, ownProps) => ({
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
})
class Work extends Component {
getImgSlider = (slider) => {
this.imgSlider = slider
}
getTextSlider = (slider) => {
this.textSlider = slider
}
componentDidMount(){
this.props.dispatch(fetchFeaturedWork());
}
render() {
let className = 'idz_work'
if (this.props.isMobile) {
className = 'idle'
}
return (
<div>
{
this.props.isMobile ?
null
:
<Link to='/home'>
<div className='idz_sidebar' style={{ left: 0 }}>
<div>
<label>FEATURED</label>
</div>
</div>
</Link>
}
<div className={className}>
{!this.props.isMobile &&
<Header logo="dark"/>
}
<div className="content">
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>Featured Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>All Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr />
</div>
{this.props.isMobile ? null : <Footer />}
</div>
</div>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Work);
javascript reactjs redux
add a comment |
up vote
0
down vote
favorite
I am calling api with redux action, so i created the reducers, action and store. But when i calling the redux action from the view part. I am getting the following error.
this.props.dispatch is not a function
Below is my reducer, actions and view part(React) Code which can help you to understand the code.
Note: when i console.log(this.props), I am not getting dispatch() function.
actions.js
import {
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from './actionTypes'
export function fetchFeaturedWork(){
return dispatch => {
return fetch("https://api.com/api/wp-json/customapi/all_posts?category=work&featured=true")
.then(res => res.json())
.then(json => {
dispatch(fetchFeaturedWorkSuccess(json.works));
return json.works;
})
};
}
export const fetchFeaturedWorkSuccess = works => ({
type: FETCH_WORKS_SUCCESS,
payload: { works }
});
reducer.js
import {
OPEN_MENU,
CLOSE_MENU,
SET_DEVICE_TYPE,
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from '../actions/actionTypes'
const initialState = {
isMenuOpen: null,
isMobile: false,
error:null,
works:
}
const reducer = (state = initialState, action) => {
switch (action.type) {
case OPEN_MENU:
return {...state, isMenuOpen: true}
case CLOSE_MENU:
return {...state, isMenuOpen: false}
case SET_DEVICE_TYPE:
return {...state, isMobile: action.isMobile}
case FETCH_WORKS_SUCCESS:
return {...state,works:action.payload.works}
case FETCH_WORKS_FAILURE:
return {...state,error:action.payload.error,works:}
default:
return state
}
}
export default reducer;
store.js
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './reducers/reducer';
import thunk from "redux-thunk";
let store = createStore(rootReducer,applyMiddleware(thunk))
export default store
App.js
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Slider from "react-slick";
import Footer from '../footer'
import './index.css';
import { connect } from 'react-redux'
import { openMenu,fetchFeaturedWork } from '../../actions/actionCreators'
import Header from '../header'
import arrowRight from '../../images/arrow-right.svg'
import arrowLeft from '../../images/arrow-left.svg'
const mapStateToProps = (state) => ({
isMobile: state && state.isMobile
})
const mapDispatchToProps = (dispatch, ownProps) => ({
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
})
class Work extends Component {
getImgSlider = (slider) => {
this.imgSlider = slider
}
getTextSlider = (slider) => {
this.textSlider = slider
}
componentDidMount(){
this.props.dispatch(fetchFeaturedWork());
}
render() {
let className = 'idz_work'
if (this.props.isMobile) {
className = 'idle'
}
return (
<div>
{
this.props.isMobile ?
null
:
<Link to='/home'>
<div className='idz_sidebar' style={{ left: 0 }}>
<div>
<label>FEATURED</label>
</div>
</div>
</Link>
}
<div className={className}>
{!this.props.isMobile &&
<Header logo="dark"/>
}
<div className="content">
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>Featured Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>All Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr />
</div>
{this.props.isMobile ? null : <Footer />}
</div>
</div>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Work);
javascript reactjs redux
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am calling api with redux action, so i created the reducers, action and store. But when i calling the redux action from the view part. I am getting the following error.
this.props.dispatch is not a function
Below is my reducer, actions and view part(React) Code which can help you to understand the code.
Note: when i console.log(this.props), I am not getting dispatch() function.
actions.js
import {
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from './actionTypes'
export function fetchFeaturedWork(){
return dispatch => {
return fetch("https://api.com/api/wp-json/customapi/all_posts?category=work&featured=true")
.then(res => res.json())
.then(json => {
dispatch(fetchFeaturedWorkSuccess(json.works));
return json.works;
})
};
}
export const fetchFeaturedWorkSuccess = works => ({
type: FETCH_WORKS_SUCCESS,
payload: { works }
});
reducer.js
import {
OPEN_MENU,
CLOSE_MENU,
SET_DEVICE_TYPE,
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from '../actions/actionTypes'
const initialState = {
isMenuOpen: null,
isMobile: false,
error:null,
works:
}
const reducer = (state = initialState, action) => {
switch (action.type) {
case OPEN_MENU:
return {...state, isMenuOpen: true}
case CLOSE_MENU:
return {...state, isMenuOpen: false}
case SET_DEVICE_TYPE:
return {...state, isMobile: action.isMobile}
case FETCH_WORKS_SUCCESS:
return {...state,works:action.payload.works}
case FETCH_WORKS_FAILURE:
return {...state,error:action.payload.error,works:}
default:
return state
}
}
export default reducer;
store.js
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './reducers/reducer';
import thunk from "redux-thunk";
let store = createStore(rootReducer,applyMiddleware(thunk))
export default store
App.js
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Slider from "react-slick";
import Footer from '../footer'
import './index.css';
import { connect } from 'react-redux'
import { openMenu,fetchFeaturedWork } from '../../actions/actionCreators'
import Header from '../header'
import arrowRight from '../../images/arrow-right.svg'
import arrowLeft from '../../images/arrow-left.svg'
const mapStateToProps = (state) => ({
isMobile: state && state.isMobile
})
const mapDispatchToProps = (dispatch, ownProps) => ({
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
})
class Work extends Component {
getImgSlider = (slider) => {
this.imgSlider = slider
}
getTextSlider = (slider) => {
this.textSlider = slider
}
componentDidMount(){
this.props.dispatch(fetchFeaturedWork());
}
render() {
let className = 'idz_work'
if (this.props.isMobile) {
className = 'idle'
}
return (
<div>
{
this.props.isMobile ?
null
:
<Link to='/home'>
<div className='idz_sidebar' style={{ left: 0 }}>
<div>
<label>FEATURED</label>
</div>
</div>
</Link>
}
<div className={className}>
{!this.props.isMobile &&
<Header logo="dark"/>
}
<div className="content">
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>Featured Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>All Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr />
</div>
{this.props.isMobile ? null : <Footer />}
</div>
</div>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Work);
javascript reactjs redux
I am calling api with redux action, so i created the reducers, action and store. But when i calling the redux action from the view part. I am getting the following error.
this.props.dispatch is not a function
Below is my reducer, actions and view part(React) Code which can help you to understand the code.
Note: when i console.log(this.props), I am not getting dispatch() function.
actions.js
import {
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from './actionTypes'
export function fetchFeaturedWork(){
return dispatch => {
return fetch("https://api.com/api/wp-json/customapi/all_posts?category=work&featured=true")
.then(res => res.json())
.then(json => {
dispatch(fetchFeaturedWorkSuccess(json.works));
return json.works;
})
};
}
export const fetchFeaturedWorkSuccess = works => ({
type: FETCH_WORKS_SUCCESS,
payload: { works }
});
reducer.js
import {
OPEN_MENU,
CLOSE_MENU,
SET_DEVICE_TYPE,
FETCH_WORKS_SUCCESS,
FETCH_WORKS_FAILURE
} from '../actions/actionTypes'
const initialState = {
isMenuOpen: null,
isMobile: false,
error:null,
works:
}
const reducer = (state = initialState, action) => {
switch (action.type) {
case OPEN_MENU:
return {...state, isMenuOpen: true}
case CLOSE_MENU:
return {...state, isMenuOpen: false}
case SET_DEVICE_TYPE:
return {...state, isMobile: action.isMobile}
case FETCH_WORKS_SUCCESS:
return {...state,works:action.payload.works}
case FETCH_WORKS_FAILURE:
return {...state,error:action.payload.error,works:}
default:
return state
}
}
export default reducer;
store.js
import { createStore, applyMiddleware } from 'redux';
import rootReducer from './reducers/reducer';
import thunk from "redux-thunk";
let store = createStore(rootReducer,applyMiddleware(thunk))
export default store
App.js
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import Slider from "react-slick";
import Footer from '../footer'
import './index.css';
import { connect } from 'react-redux'
import { openMenu,fetchFeaturedWork } from '../../actions/actionCreators'
import Header from '../header'
import arrowRight from '../../images/arrow-right.svg'
import arrowLeft from '../../images/arrow-left.svg'
const mapStateToProps = (state) => ({
isMobile: state && state.isMobile
})
const mapDispatchToProps = (dispatch, ownProps) => ({
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
})
class Work extends Component {
getImgSlider = (slider) => {
this.imgSlider = slider
}
getTextSlider = (slider) => {
this.textSlider = slider
}
componentDidMount(){
this.props.dispatch(fetchFeaturedWork());
}
render() {
let className = 'idz_work'
if (this.props.isMobile) {
className = 'idle'
}
return (
<div>
{
this.props.isMobile ?
null
:
<Link to='/home'>
<div className='idz_sidebar' style={{ left: 0 }}>
<div>
<label>FEATURED</label>
</div>
</div>
</Link>
}
<div className={className}>
{!this.props.isMobile &&
<Header logo="dark"/>
}
<div className="content">
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>Featured Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<label className="light-gray" style={this.props.isMobile ? { fontSize: '1.3rem' } : { fontSize: '2rem' }}>All Works</label>
<hr style={this.props.isMobile ? { marginBottom: '0.5rem', marginTop: '0.5rem' } : {}} />
<hr />
</div>
{this.props.isMobile ? null : <Footer />}
</div>
</div>
);
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Work);
javascript reactjs redux
javascript reactjs redux
edited Nov 14 at 6:35
asked Nov 14 at 5:48
user10298495
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14
add a comment |
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
When you use mapDispatchToProps, dispatch is not longer available in props. So, either get rid of mapDispatchToProps and use this.props.dispatch. Or move all dispatch functions to mapDispatchToProps.
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action -openMenu()
to the store. The result ofopenMenu()
is an action.
– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
movethis.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.
– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
When you use mapDispatchToProps, dispatch is not longer available in props. So, either get rid of mapDispatchToProps and use this.props.dispatch. Or move all dispatch functions to mapDispatchToProps.
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action -openMenu()
to the store. The result ofopenMenu()
is an action.
– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
movethis.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.
– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
|
show 1 more comment
up vote
0
down vote
When you use mapDispatchToProps, dispatch is not longer available in props. So, either get rid of mapDispatchToProps and use this.props.dispatch. Or move all dispatch functions to mapDispatchToProps.
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action -openMenu()
to the store. The result ofopenMenu()
is an action.
– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
movethis.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.
– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
|
show 1 more comment
up vote
0
down vote
up vote
0
down vote
When you use mapDispatchToProps, dispatch is not longer available in props. So, either get rid of mapDispatchToProps and use this.props.dispatch. Or move all dispatch functions to mapDispatchToProps.
When you use mapDispatchToProps, dispatch is not longer available in props. So, either get rid of mapDispatchToProps and use this.props.dispatch. Or move all dispatch functions to mapDispatchToProps.
answered Nov 14 at 5:58
vijayst
5,83893575
5,83893575
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action -openMenu()
to the store. The result ofopenMenu()
is an action.
– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
movethis.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.
– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
|
show 1 more comment
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action -openMenu()
to the store. The result ofopenMenu()
is an action.
– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
movethis.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.
– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
actually i don't know functionality of mapDispatchToProps. Can you please explain me what it is? and you can see, I used the this.props.dispatch and getting the error "this.props.dispatch is not a function"
– user10298495
Nov 14 at 5:59
It defines a prop (of function type) to dispatch an action to the store. From your code,
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action - openMenu()
to the store. The result of openMenu()
is an action.– vijayst
Nov 14 at 6:03
It defines a prop (of function type) to dispatch an action to the store. From your code,
openMenu: (isMobile) => dispatch(openMenu(ownProps.isMobile))
, openMenu is the function prop that you have defined. It dispatches an action - openMenu()
to the store. The result of openMenu()
is an action.– vijayst
Nov 14 at 6:03
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
so what i need to do now to solve the error?
– user10298495
Nov 14 at 6:08
move
this.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.– vijayst
Nov 14 at 6:10
move
this.props.dispatch(fetchFeaturedWork());
to mapDispatchToProps just like the other function you have there.– vijayst
Nov 14 at 6:10
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
I have done but getting the error. can you please edit the code?
– user10298495
Nov 14 at 6:11
|
show 1 more comment
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53293891%2fthis-props-dispatch-is-not-a-function-in-react-with-redux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Possible Duplicate of React Redux mapDispatchToProps vs this.props.dispatch or How does connect work without mapDispatchToProps
– Shubham Khatri
Nov 14 at 6:08
Possible duplicate of React Redux mapDispatchToProps vs this.props.dispatch
– vijayst
Nov 14 at 6:14