Closed ajeetvarma closed 6 years ago
Thank you for the feedback, @ajeetvarma !
Due to Redux documentation https://redux.js.org/docs/basics/Actions.html, action contains from type and some data only. But you always may pass data like an object to pass more details to API:
const payload = { searchQuery: 'react', pageNum: 1 }; this.props.dispatch(searchMediaAction(payload));
And use this in the API:
export const flickrImages = (payload) => { const searchQuery = payload.searchQuery; const pageNum = payload.pageNum; ...
or using ES6 features just like this:
export const flickrImages = ({searchQuery, pageNum}) => { ...
In this case you may pass everything you need. Hope it helps :)
Thanks for such a amazing package. It is the best package to which i understand solution for server side rendering . I have a little issue . Images have been fetched at
/media
route after passing one argumentsearchQuery
insrc/api/media/flickrImages
api . I have need to pass one more argument likepageNum
like this(searchQuery, pageNum)
.And in
src/view/media/
file i have called redux call like this belowIn api i have done like this
But unfortunately value of
pageNum
in api calling is coming asundefined
like thisPlease suggest me to pass more than one argument in api call while i will not have to use routes params actually ..
Thanks a lot