我正在使用Gatsby构建静态站点。我正在使用"gatsby-starter-fine"示例入门项目,并通过gatsby-plugin-material-ui插件使用Material UI。尽管我的项目可以正常编译,并且项目托管在http://localhost:8000/上,但是使用实质性UI组件的页面显示为空白。
有帮助吗?
import React from "react";
import { graphql } from "gatsby";
import Layout from "../components/layout";
import { MainPost, Title } from "../components/style/emo-post";
import Typography from "@material-ui/core/Typography";
export default ({ data }) => {
return (
<Layout>
<MainPost>
<header>
<Title>Single Page</Title>
</header>
<div
className={"content"}>
<p>Lorem ipsum dolor.
</p>
<h1>h1 title</h1>
<span>Lorem ipsum dolor s.</span>
<Typography>Hello Material UI</Typography>
</div>
</MainPost>
</Layout>
);
};
export const query = graphql`
query {
site {
siteMetadata {
subtitle
}
}
}