My post values are not passing to component.
But from my network url I am able to see the data:
This is my Url 👍 http://reduxblog.herokuapp.com/api/posts?key=Hello123Response:
[{"id":233702,"title":"Test","categories":"Test","content":"Test"},{"id":233700,"title":"Test","categories":"Test","content":"Test"},{"id":233699,"title":"Test","categories":"Test","content":"Test"}]
JUst I tried to get action payload data in 'reducer_posts.js' file. added console.log
import _ from 'lodash';
import { FETCH_POSTS } from '../actions';
export default function (state = {},action) {
console.log(action.payload);
switch (action.type) {
case FETCHPOSTS:
return .mapKeys(action.payload.data, 'id');
default:
return state;
}
}
First 3 times getting undefined and 4th time getting promise data . Could you please help me to get resolve this issue.
If I use any other api url also I am getting same error.
Tried with different API URL too.
https://jsonplaceholder.typicode.com/users
Might be some problem in my promise code.
Please help me .
Hello MR StephenGrider,
My post values are not passing to component. But from my network url I am able to see the data: This is my Url 👍 http://reduxblog.herokuapp.com/api/posts?key=Hello123 Response: [{"id":233702,"title":"Test","categories":"Test","content":"Test"},{"id":233700,"title":"Test","categories":"Test","content":"Test"},{"id":233699,"title":"Test","categories":"Test","content":"Test"}]
JUst I tried to get action payload data in 'reducer_posts.js' file. added console.log
import _ from 'lodash'; import { FETCH_POSTS } from '../actions';
export default function (state = {},action) {
console.log(action.payload); switch (action.type) {
case FETCHPOSTS:
return .mapKeys(action.payload.data, 'id');
}
First 3 times getting undefined and 4th time getting promise data . Could you please help me to get resolve this issue.
Thank You