我正在看Gatsby.js教程,在教程二中,你必须导入一些字体。当我尝试导入theme lawton时,我在import lawtonTheme from "typography-theme-lawton";下看到以下错误
我首先做的是npm install --save typography-theme-lawton
Could not find a declaration file for module 'typography-theme-lawton'. '/Users/react/tutorial-part-two/node_modules/
我使用情感在我的项目中制作样式组件,现在它给我带来了问题。我是这样安装的:
npm i @emotion/react @emotion/styled gatsby-plugin-emotion
例如,如果我想在Header组件中使用它,我会这样做:
import React from 'react';
import { Link } from 'gatsby';
import Navegacion from './navegacion';
import { jsx, css } from '@emotion/react';
co
我已经将gatsby-plugin-layout安装到我的项目文件中,创建了src/layouts/index.js,并将gatsby-plugin-layout添加到gatsby-config.js中。Gatsby应用程序编译并可以在开发服务器上服务,但是通过我的布局组件的console.log输出,我看到布局组件仍然在每个页面加载上重新挂载。我的目标是让布局组件在反应应用的过程中只挂载一次。
src/layouts/index.js
import React from "react"
import Header from "../components/header&
我在开发Gatsby项目时遇到了一个问题。有了Gatsby Develop,一切都在正常运行,但最近开始了构建过程并部署了网站。 在浏览器上启动网站后,我得到了以下错误。这是关于我的页面目录中的创新文件: 错误:未找到/innovation/的页面资源。未渲染React 加载资源失败:服务器响应状态为404 () (page-data.json) 我想也许我使用的组件或库在prod中打破了页面。我将源代码还原为模板,如下所示: import React from "react";
import { Link } from "gatsby";
import L