Hi!
For 2 weeks I have been working with frontity and learning how to works. So far, so good. I am a very experienced Wordpress developer, but not very experienced working with Frontity or React, in fact, this is the first time I’m doing a react project.
I’m currently developing a theme based on the awsf1, which was a really good base to learn from (IMO).
Right now I’m currently stuck with the frontpage because I want to query 1 custom post type and 1 normal post type and list everything. But the data wont fetch, which messes up the map-function
Here’s my snippet for fetching the 2 data sources:
const HomePage = ({ state, actions, libraries }) => {
// Get information about the current URL.
const data = state.source.get(state.router.link);
// Get the data of the post.
const homepage = state.source[data.type][data.id];
// Get the html2react component.
const Html2React = libraries.html2react.Component;
//const BannerSlider = homepage.acf.banner_slider;
useEffect(() => {
actions.source.fetch("/");
List.preload();
}, []);
**const blogposts = state.source.get('/posts');**
**const reviews = state.source.get('/prp_reviews');**
I’ve bolded the 2 data sources. I would really appreciate someone pointing me in the right direction.
Best regards,
Marten