我正在使用盖茨比,反应,这是一个标题组件。
我想在nav.gnbUl上添加一个类,它通过onClick事件匹配路径名。它工作在一个普通的反应页面,但这次它没有在盖茨比网站。
它说,TypeError:无法读取属性“替换”的未定义的部分,我应该修复?
import React, { useState } from "react"
import { Link } from "gatsby"
//import PropTypes from "prop-types"
import logo from "../img/logo/logo.svg
错误:
React Hook "useState" is called in function "createFlight" that is
neither a React function component nor a custom React Hook function.
React component names must start with an uppercase letter react-
hooks/rules-of-hooks
我的代码:
import React, {Component} from 'react'
你好,我目前正在挣扎的‘反应-路由器-多姆’@6链接元素。单击属于Link的注册文本允许浏览器url变为localhost:5000 -> localhost:5000/signup,但仍然没有出现signup组件。我不知道在哪里纠正我的代码。
import Form from './components/form';
import Comments from './components/comments';
import Header from './components/header';
import Signup from '