Hello,
while i was using loadable in index.js of home component, I got this error
Invariant Violation: loadable: cannot find home in stats
and here is my index file and home component code,
index.js
import { loadable } from "frontity";
export default loadable(() => import("./home"));
home.js
import React from "react";
import { connect } from "frontity";
import TopArticle from "./topArticle";
import ListArticle from "./listArticle";
import LatestArticle from "./latestArticle";
/**
* call all api and fetch data here and show loading from here after render child component
*/
const Home = ({ themeMode }) => {
return (
<>
{/* call api and show loading until get all articles */}
<TopArticle />
{/* call api and show loading until get all list articles */}
<ListArticle themeMode={themeMode} />
<LatestArticle themeMode={themeMode} />
</>
);
};
export default connect(Home);
Hello @juanma
i can’t understand what’s problem, i am getting same error
i already posted my home component and index file, let me explain you how i want to use loadble
when user visit to home it should not load isPost component and it’s working fine, but if user directly visit to blog url then it should not load home component it will load only post component, but there is same error for home component
here is code of index where i import both home and blog component
@juanma thank you so much for fast response and its working fine,
but can you tell me why i can not directly use loadable with homepage as i was trying before.