Redux Thunk + ReactJS: Action creator being called but dispatch function not being called
up vote
1
down vote
favorite
I'm encountering a rather strange problem with my ReactJS x Redux app that I've never seen before and am having a hard time figuring out.
In my ReactJS component I'm wiring up an action creator function that's using redux-thunk
to make async calls before dispatching to a reducer using the connect()
function from react-redux
+ the object mapDispatchToProps
notation. It looks like this:
const mapStateToProps = (state) => ({
...state.single_pano
});
const mapDispatchToProps = {
loadPano
};
export default connect(mapStateToProps, mapDispatchToProps)(PanoView);
For the sake of simplicity, let's say the loadPano
action creator looks something like this:
export const loadPano = (id) => {
console.log('Action creator called.');
return async (dispatch) => {
console.log('Dispatch function called.');
const doc = await db.doc('/path/to/doc/'+id).get();
dispatch({
type: 'LOAD_ACTION',
payload: doc
});
}
}
Here's where things get weird:
In my componentDidMount()
lifecycle function, I'm making a call to this.props.loadPano(panoID)
which works exactly as expected (both console.log()
calls in the action creator are invoked, the async
/await
returns and the action is dispatched to the reducer).
Later, I need to call this.props.loadPano(panoID)
again in the component's componentWillReceiveProps()
lifecycle function because a URL parameter is changed, and some data needs to be fetched and reloaded. HOWEVER, what ends up happening this time is the action creator (loadPano
) is called, but the redux-thunk
dispatch function (return (dispatch) => { ... }
) never gets called. I can tell this is the case because the first console.log()
is called, but the second one never is never logged to the console.
Other things slighty out of the ordinary that I'm doing that might be related, but so far I've been unable to confirm any of it:
- The
PanoView
component makes use ofshouldComponentUpdate()
lifecycle method to control when the DOM is rendered. - I'm being a little hacky / not best practice-y using a variable outside of the
PanoView
component's state to store an 3rd party library object that modifies the DOM directly via a DOMref
, and can't really be used properly in conjunction with ReactJS. However I believe this to be isolated, and can't see how it would be interfering with Redux / Thunk. Especially because the dispatch function fires correctly the first time.
Relevant dependencies + versions (installed via yarn
):
"firebase": "^5.2.0",
"photo-sphere-viewer": "^3.4.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
Requested updates:
My componentWillReceiveProps
lifecylce function for the PanoView
component looks as follows:
componentWillReceiveProps(newProps) {
// Pano received
const oldPanoID = this.props.match.params.panoID;
const newPanoID = newProps.match.params.panoID;
if (oldPanoID !== newPanoID) {
loadPano(newPanoID);
}
}
javascript reactjs redux react-redux
add a comment |
up vote
1
down vote
favorite
I'm encountering a rather strange problem with my ReactJS x Redux app that I've never seen before and am having a hard time figuring out.
In my ReactJS component I'm wiring up an action creator function that's using redux-thunk
to make async calls before dispatching to a reducer using the connect()
function from react-redux
+ the object mapDispatchToProps
notation. It looks like this:
const mapStateToProps = (state) => ({
...state.single_pano
});
const mapDispatchToProps = {
loadPano
};
export default connect(mapStateToProps, mapDispatchToProps)(PanoView);
For the sake of simplicity, let's say the loadPano
action creator looks something like this:
export const loadPano = (id) => {
console.log('Action creator called.');
return async (dispatch) => {
console.log('Dispatch function called.');
const doc = await db.doc('/path/to/doc/'+id).get();
dispatch({
type: 'LOAD_ACTION',
payload: doc
});
}
}
Here's where things get weird:
In my componentDidMount()
lifecycle function, I'm making a call to this.props.loadPano(panoID)
which works exactly as expected (both console.log()
calls in the action creator are invoked, the async
/await
returns and the action is dispatched to the reducer).
Later, I need to call this.props.loadPano(panoID)
again in the component's componentWillReceiveProps()
lifecycle function because a URL parameter is changed, and some data needs to be fetched and reloaded. HOWEVER, what ends up happening this time is the action creator (loadPano
) is called, but the redux-thunk
dispatch function (return (dispatch) => { ... }
) never gets called. I can tell this is the case because the first console.log()
is called, but the second one never is never logged to the console.
Other things slighty out of the ordinary that I'm doing that might be related, but so far I've been unable to confirm any of it:
- The
PanoView
component makes use ofshouldComponentUpdate()
lifecycle method to control when the DOM is rendered. - I'm being a little hacky / not best practice-y using a variable outside of the
PanoView
component's state to store an 3rd party library object that modifies the DOM directly via a DOMref
, and can't really be used properly in conjunction with ReactJS. However I believe this to be isolated, and can't see how it would be interfering with Redux / Thunk. Especially because the dispatch function fires correctly the first time.
Relevant dependencies + versions (installed via yarn
):
"firebase": "^5.2.0",
"photo-sphere-viewer": "^3.4.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
Requested updates:
My componentWillReceiveProps
lifecylce function for the PanoView
component looks as follows:
componentWillReceiveProps(newProps) {
// Pano received
const oldPanoID = this.props.match.params.panoID;
const newPanoID = newProps.match.params.panoID;
if (oldPanoID !== newPanoID) {
loadPano(newPanoID);
}
}
javascript reactjs redux react-redux
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
@Colin Not sure I understand, I'm using the object notation formapDispatchToProps
+react-redux
'sconnect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizingredux-thunk
) that callsdispatch
after theawait
/ promise returns. I believeredux-thunk
is responsible for passing indispatch
.
– saricden
Nov 18 at 12:42
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
1
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
1
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm encountering a rather strange problem with my ReactJS x Redux app that I've never seen before and am having a hard time figuring out.
In my ReactJS component I'm wiring up an action creator function that's using redux-thunk
to make async calls before dispatching to a reducer using the connect()
function from react-redux
+ the object mapDispatchToProps
notation. It looks like this:
const mapStateToProps = (state) => ({
...state.single_pano
});
const mapDispatchToProps = {
loadPano
};
export default connect(mapStateToProps, mapDispatchToProps)(PanoView);
For the sake of simplicity, let's say the loadPano
action creator looks something like this:
export const loadPano = (id) => {
console.log('Action creator called.');
return async (dispatch) => {
console.log('Dispatch function called.');
const doc = await db.doc('/path/to/doc/'+id).get();
dispatch({
type: 'LOAD_ACTION',
payload: doc
});
}
}
Here's where things get weird:
In my componentDidMount()
lifecycle function, I'm making a call to this.props.loadPano(panoID)
which works exactly as expected (both console.log()
calls in the action creator are invoked, the async
/await
returns and the action is dispatched to the reducer).
Later, I need to call this.props.loadPano(panoID)
again in the component's componentWillReceiveProps()
lifecycle function because a URL parameter is changed, and some data needs to be fetched and reloaded. HOWEVER, what ends up happening this time is the action creator (loadPano
) is called, but the redux-thunk
dispatch function (return (dispatch) => { ... }
) never gets called. I can tell this is the case because the first console.log()
is called, but the second one never is never logged to the console.
Other things slighty out of the ordinary that I'm doing that might be related, but so far I've been unable to confirm any of it:
- The
PanoView
component makes use ofshouldComponentUpdate()
lifecycle method to control when the DOM is rendered. - I'm being a little hacky / not best practice-y using a variable outside of the
PanoView
component's state to store an 3rd party library object that modifies the DOM directly via a DOMref
, and can't really be used properly in conjunction with ReactJS. However I believe this to be isolated, and can't see how it would be interfering with Redux / Thunk. Especially because the dispatch function fires correctly the first time.
Relevant dependencies + versions (installed via yarn
):
"firebase": "^5.2.0",
"photo-sphere-viewer": "^3.4.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
Requested updates:
My componentWillReceiveProps
lifecylce function for the PanoView
component looks as follows:
componentWillReceiveProps(newProps) {
// Pano received
const oldPanoID = this.props.match.params.panoID;
const newPanoID = newProps.match.params.panoID;
if (oldPanoID !== newPanoID) {
loadPano(newPanoID);
}
}
javascript reactjs redux react-redux
I'm encountering a rather strange problem with my ReactJS x Redux app that I've never seen before and am having a hard time figuring out.
In my ReactJS component I'm wiring up an action creator function that's using redux-thunk
to make async calls before dispatching to a reducer using the connect()
function from react-redux
+ the object mapDispatchToProps
notation. It looks like this:
const mapStateToProps = (state) => ({
...state.single_pano
});
const mapDispatchToProps = {
loadPano
};
export default connect(mapStateToProps, mapDispatchToProps)(PanoView);
For the sake of simplicity, let's say the loadPano
action creator looks something like this:
export const loadPano = (id) => {
console.log('Action creator called.');
return async (dispatch) => {
console.log('Dispatch function called.');
const doc = await db.doc('/path/to/doc/'+id).get();
dispatch({
type: 'LOAD_ACTION',
payload: doc
});
}
}
Here's where things get weird:
In my componentDidMount()
lifecycle function, I'm making a call to this.props.loadPano(panoID)
which works exactly as expected (both console.log()
calls in the action creator are invoked, the async
/await
returns and the action is dispatched to the reducer).
Later, I need to call this.props.loadPano(panoID)
again in the component's componentWillReceiveProps()
lifecycle function because a URL parameter is changed, and some data needs to be fetched and reloaded. HOWEVER, what ends up happening this time is the action creator (loadPano
) is called, but the redux-thunk
dispatch function (return (dispatch) => { ... }
) never gets called. I can tell this is the case because the first console.log()
is called, but the second one never is never logged to the console.
Other things slighty out of the ordinary that I'm doing that might be related, but so far I've been unable to confirm any of it:
- The
PanoView
component makes use ofshouldComponentUpdate()
lifecycle method to control when the DOM is rendered. - I'm being a little hacky / not best practice-y using a variable outside of the
PanoView
component's state to store an 3rd party library object that modifies the DOM directly via a DOMref
, and can't really be used properly in conjunction with ReactJS. However I believe this to be isolated, and can't see how it would be interfering with Redux / Thunk. Especially because the dispatch function fires correctly the first time.
Relevant dependencies + versions (installed via yarn
):
"firebase": "^5.2.0",
"photo-sphere-viewer": "^3.4.0",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0"
Requested updates:
My componentWillReceiveProps
lifecylce function for the PanoView
component looks as follows:
componentWillReceiveProps(newProps) {
// Pano received
const oldPanoID = this.props.match.params.panoID;
const newPanoID = newProps.match.params.panoID;
if (oldPanoID !== newPanoID) {
loadPano(newPanoID);
}
}
javascript reactjs redux react-redux
javascript reactjs redux react-redux
edited Nov 20 at 15:20
asked Nov 18 at 12:13
saricden
4001726
4001726
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
@Colin Not sure I understand, I'm using the object notation formapDispatchToProps
+react-redux
'sconnect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizingredux-thunk
) that callsdispatch
after theawait
/ promise returns. I believeredux-thunk
is responsible for passing indispatch
.
– saricden
Nov 18 at 12:42
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
1
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
1
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12
add a comment |
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
@Colin Not sure I understand, I'm using the object notation formapDispatchToProps
+react-redux
'sconnect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizingredux-thunk
) that callsdispatch
after theawait
/ promise returns. I believeredux-thunk
is responsible for passing indispatch
.
– saricden
Nov 18 at 12:42
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
1
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
1
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
@Colin Not sure I understand, I'm using the object notation for
mapDispatchToProps
+ react-redux
's connect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizing redux-thunk
) that calls dispatch
after the await
/ promise returns. I believe redux-thunk
is responsible for passing in dispatch
.– saricden
Nov 18 at 12:42
@Colin Not sure I understand, I'm using the object notation for
mapDispatchToProps
+ react-redux
's connect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizing redux-thunk
) that calls dispatch
after the await
/ promise returns. I believe redux-thunk
is responsible for passing in dispatch
.– saricden
Nov 18 at 12:42
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
1
1
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
1
1
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
It is hard (almost impossible) to guess where the problem is when we don't know anything about your code. How does your componentWillReceiveProps
look like?
This is a good practice that might cause a confusion:
const mapDispatchToProps = {
loadPano
};
Redux thunk is essentially a middleware that checks every dispatched action. If the action returns a function, then it calls the function and then it passes dispatch
and state
parameters to the returned function and then it also calls this function.
So my guess is:
- In
componendDidMount
you are callingthis.props.loadPano(id)
- In
componentWillReceiveProps
you calling onlyloadPano
.
The first one is store.dispatch(loadPano)
and gets into the reducer. The second one is just loadPano
and returns a promise. (your action creator)
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
It is hard (almost impossible) to guess where the problem is when we don't know anything about your code. How does your componentWillReceiveProps
look like?
This is a good practice that might cause a confusion:
const mapDispatchToProps = {
loadPano
};
Redux thunk is essentially a middleware that checks every dispatched action. If the action returns a function, then it calls the function and then it passes dispatch
and state
parameters to the returned function and then it also calls this function.
So my guess is:
- In
componendDidMount
you are callingthis.props.loadPano(id)
- In
componentWillReceiveProps
you calling onlyloadPano
.
The first one is store.dispatch(loadPano)
and gets into the reducer. The second one is just loadPano
and returns a promise. (your action creator)
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
|
show 1 more comment
up vote
1
down vote
accepted
It is hard (almost impossible) to guess where the problem is when we don't know anything about your code. How does your componentWillReceiveProps
look like?
This is a good practice that might cause a confusion:
const mapDispatchToProps = {
loadPano
};
Redux thunk is essentially a middleware that checks every dispatched action. If the action returns a function, then it calls the function and then it passes dispatch
and state
parameters to the returned function and then it also calls this function.
So my guess is:
- In
componendDidMount
you are callingthis.props.loadPano(id)
- In
componentWillReceiveProps
you calling onlyloadPano
.
The first one is store.dispatch(loadPano)
and gets into the reducer. The second one is just loadPano
and returns a promise. (your action creator)
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
|
show 1 more comment
up vote
1
down vote
accepted
up vote
1
down vote
accepted
It is hard (almost impossible) to guess where the problem is when we don't know anything about your code. How does your componentWillReceiveProps
look like?
This is a good practice that might cause a confusion:
const mapDispatchToProps = {
loadPano
};
Redux thunk is essentially a middleware that checks every dispatched action. If the action returns a function, then it calls the function and then it passes dispatch
and state
parameters to the returned function and then it also calls this function.
So my guess is:
- In
componendDidMount
you are callingthis.props.loadPano(id)
- In
componentWillReceiveProps
you calling onlyloadPano
.
The first one is store.dispatch(loadPano)
and gets into the reducer. The second one is just loadPano
and returns a promise. (your action creator)
It is hard (almost impossible) to guess where the problem is when we don't know anything about your code. How does your componentWillReceiveProps
look like?
This is a good practice that might cause a confusion:
const mapDispatchToProps = {
loadPano
};
Redux thunk is essentially a middleware that checks every dispatched action. If the action returns a function, then it calls the function and then it passes dispatch
and state
parameters to the returned function and then it also calls this function.
So my guess is:
- In
componendDidMount
you are callingthis.props.loadPano(id)
- In
componentWillReceiveProps
you calling onlyloadPano
.
The first one is store.dispatch(loadPano)
and gets into the reducer. The second one is just loadPano
and returns a promise. (your action creator)
answered Nov 20 at 15:16
Michal
2,2241135
2,2241135
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
|
show 1 more comment
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
1
1
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
Updated the OP. I can't believe I missed this, you were totally correct. Thanks dude, much appreciated. Sometimes the most obvious answers slip right by when you're too close to the action.
– saricden
Nov 20 at 15:22
1
1
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
I can't reward the bounty yet, but will as soon as I can. Thanks again.
– saricden
Nov 20 at 15:23
1
1
I am glad it worked. :)
– Michal
Nov 20 at 15:23
I am glad it worked. :)
– Michal
Nov 20 at 15:23
1
1
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
Going to be able to release the 2nd beta after this :) I was stuck on this problem all weekend.
– saricden
Nov 20 at 15:37
1
1
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
Interesting, I'll defs still check it out, could be useful for future bugs :)
– saricden
Nov 20 at 15:49
|
show 1 more comment
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%2f53360725%2fredux-thunk-reactjs-action-creator-being-called-but-dispatch-function-not-bei%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
Can you show where you're passing dispatch?
– Colin
Nov 18 at 12:18
@Colin Not sure I understand, I'm using the object notation for
mapDispatchToProps
+react-redux
'sconnect()
to wire up the action creator to the component's props, then in the action creator I'm returning a function (utilizingredux-thunk
) that callsdispatch
after theawait
/ promise returns. I believeredux-thunk
is responsible for passing indispatch
.– saricden
Nov 18 at 12:42
Could you please share a link to github repo?
– Michal
Nov 20 at 15:05
1
Uh currently it's hosted on a private Bitbucket repo... I've been meaning to move it to GH, but haven't gotten around to it yet.
– saricden
Nov 20 at 15:11
1
@Michal I'll make it a priority tomorrow after I finish work. Should be able to get it up by EOD tomorrow (I'm on Korean Standard Time).
– saricden
Nov 20 at 15:12