Site loads differently depending on what url you start from

Hello, I just started using Frontity but couldn’t find anything like what I have run into. I am building a site that uses the pages made in wordpress so the client is able to customize the page as they see fit. In doing so I have run into an issue where when I load the page from the standard url and click on the nav bar, the page 404’s. If I were to then refresh the page would load normally. In addition if I then go back to the home page, the images on the home page don’t load until I refresh.

I am using a custom theme. The only thing I have done with the theme right now is make a few components. I have not messed with the Frontity settings much other than adding the homepage and postPage slugs.

As I said above, I am very new to Frontity so any feedback would be great!

This is how I am trying to achieve what I described above.
Root component is doing:

const data = state.source.get(state.router.link);

And passing to my page component where this happens:

let pageData = state.source.get(data.route);
let id = pageData.id;
if (id) {
    let page = state.source.page[id].content.rendered;
    return (
        <div
            dangerouslySetInnerHTML={{
                __html: page
            }}
        ></div>
    );
} else {
    return <Page404 />;
}

Hi @jessewburnley

Welcome to the Frontity community.

It would be useful to see your code in context, so it would be helpful if you can provide a link to a repo.

However, an initial impression is that you don’t need to doing let pageData = state.source.get(data.route);. That just gives you what you’ve already got in state.router.link.

Also pageData is just the route, it doesn’t have an id property. The data returned by state.source.get(state.router.link) has the id property that you need anyway.

Let me know if this helps. Otherwise please provide a link to a repo. Thanks.