css 如何使用flowbite-react中的导航栏组件

euoag5mw  于 2023-02-06  发布在  React
关注(0)|答案(1)|浏览(160)

我已经安装了here所指示的要求。
在App.jsx文件中复制完整的Default navbar代码后,出现的问题是

`Uncaught ReferenceError: React is not defined`.

与路由器组件或类似的东西有关?,这里还需要哪些额外的组件?

默认导航栏代码

<Navbar
  fluid={true}
  rounded={true}
>
  <Navbar.Brand
    as={{
      $$typeof: Symbol(react.forward_ref),
      render: LinkWithRef
    }}
    to="/navbars"
  >
    <img
      src="https://flowbite.com/docs/images/logo.svg"
      className="mr-3 h-6 sm:h-9"
      alt="Flowbite Logo"
    />
    <span className="self-center whitespace-nowrap text-xl font-semibold dark:text-white">
      Flowbite
    </span>
  </Navbar.Brand>
  <Navbar.Toggle />
  <Navbar.Collapse>
    <Navbar.Link
      href="/navbars"
      active={true}
    >
      Home
    </Navbar.Link>
    <Navbar.Link
      as={{
        $$typeof: Symbol(react.forward_ref),
        render: LinkWithRef
      }}
      to="/navbars"
    >
      About
    </Navbar.Link>
    <Navbar.Link href="/navbars">
      Services
    </Navbar.Link>
    <Navbar.Link href="/navbars">
      Pricing
    </Navbar.Link>
    <Navbar.Link href="/navbars">
      Contact
    </Navbar.Link>
  </Navbar.Collapse>
</Navbar>

hfsqlsce

hfsqlsce1#

尝试取消注解React import语句。例如:import React from 'react'

相关问题