我一直在我的 React Web 应用程序上收到此警告,但不确定如何解决此问题。我对 React 还很陌生,并尝试通过谷歌搜索,但仍然没有找到解决方案。
Warning: React does not recognize the `activeKey` prop on a DOM element. If
you intentionally want it to appear in the DOM as a custom
attribute, spell it as lowercase `activekey` instead. If you
accidentally passed it from a parent component, remove it from the
DOM element.
in div (created by NavbarForm)
in NavbarForm (created by Header)
in ul (created by Nav)
in Nav (created by Header)
in div (created by Grid)
in Grid (created by Navbar)
in nav (created by Navbar)
in Navbar (created by Uncontrolled(Navbar))
in Uncontrolled(Navbar) (created by Header)
in Header (created by App)
in div (created by App)
in App
这是我的标题的代码
import * as React from 'react';
import { Button, FormControl, FormGroup, Nav, Navbar, NavItem} from 'react-bootstrap';
const Header = (props : any) => {
return (
<Navbar>
<Navbar.Header>
<Navbar.Brand>
<NavItem href="/">
RedQuick
</NavItem>
</Navbar.Brand>
</Navbar.Header>
<Nav>
<Navbar.Form>
<form onSubmit={ props.getRedditPost }>
<FormGroup>
<FormControl
type="text"
name="subreddit"
placeholder="Subreddit Name..."
/>
</FormGroup>
<Button type="submit">Search</Button>
</form>
</Navbar.Form>
</Nav>
</Navbar>
);
};
export default Header;