static defaultProps = {
featureImage: "",
featureRatio: "16x9"
}
const PostLazy = lazy<PostProps>(
(): any => import("../components/Post")
);
<PostLazy
featureImage={item.featureImage}
/>
Cannot create `PostLazy` element because property `featureRatio` is missing
in props [1] but exists in `PostProps` [2].
import Post from "../components/Post";
You should use lazy<React.Config<Props, DefaultProps>> to keep default props optional. You'll also need to make a DefaultProps type alias for the class.
Most helpful comment
You should use
lazy<React.Config<Props, DefaultProps>>to keep default props optional. You'll also need to make a DefaultProps type alias for the class.