最近,我将Gatsby的版本从2.X升级到3.X,并遇到了很多错误。我正在使用TypeScript,但这是我第一次使用PageProps。但是,我得到了一个错误,我假设它来自PageProps,而不是传递给index.tsx组件中的Home。有人能帮我澄清一下吗?
错误:
Type '{}' is missing the following properties from type 'PageProps<object, object, unknown>': path, uri, location, navigate, and 5 more.ts(27
盖茨比新手来了,对我耐心点。我正在用Gatsby和React构建一个非常基本的博客应用。我有一个登陆页,其中一个部分,我显示了最新的3个博客帖子,已发表。到目前为止,我的index.js文件中的以下代码一切正常: import React from 'react'
import { Link, graphql } from 'gatsby'
import get from 'lodash/get'
import Bio from '../components/Bio'
import Layout from '../co
我正在使用Gatsby创建一个博客。Gatsby可以使用带有GraphQL的markdown为你“自动”创建帖子页面。我在想用Gatsby example here。 在storybook UI中,“模拟”出graphql查询并将其替换为我们的markdown数据的最佳方式是什么?这样我就可以在Storybook UI中测试这个组件。例如,如果我有一个博客模板,如下所示: import { graphql } from 'gatsby';
import React from 'react';
export default function Template(
我正在尝试使用组件的onClick事件重定向到页面。因为我已经安装了react gatsby,所以可以从gatsby-link使用Link来重定向吗? import React from 'react';
import { OverflowMenu, OverflowMenuItem } from '../Overflow';
import Link from 'gatsby-theme-carbon/src/components/Link';
class OverflowComponent extends React.Component
我正在与盖茨比一起构建一个博客,我试图在每个帖子页面上显示一个英雄形象,每个帖子前面的内容都定义了图像路径。但是,我从我的英雄部分得到了这个错误:
TypeError: Cannot read property 'image' of undefined
这是我的代码:
邮政前沿事项
---
path: /blog-post1
title: Blog Post 1
image: ../../images/blog-post-1.jpg
description: Blog post description
---
Hero.js
import React from 'rea
我有一个组件,其中需要包含来自Marketo的form。
在后端,我有一个名为form_id的ACF字段。我的想法是,用户可以在后端输入标记表单ID,我将把该字段中的值传递到组件中的<script>代码段中,它将找到相关的表单。
目前,我正在尝试使用react-helmet,但是,由于后端的字段值,它出现了错误(TypeError: tag[primaryAttributeKey].toLowerCase is not a function)。
以下是嵌入代码在Marketo中的显示方式(以表单ID 9999为例):
<script src="//url.com/