首页 > 解决方案 > 使用 react-button 给出未知道具的警告

问题描述

在 package.json 的依赖项中,我有:

"react": "15.6.1",
"react-dom": "15.6.1",
"react-button": "1.2.1"

当我简单地导入按钮时

import Button from 'react-button'

然后将其用作:

<Button>Hello</Button>

这给了我以下警告:

Warning: Unknown props `isReactButton`, `applyDefaultTheme`, `buttonStates`, `align`, `defaultStyle`, `defaultDisabledStyle`, `defaultLabelStyle`, `ellipsisLabelStyle`, `ellipsis`, `themes`, `theme`, `active`, `over`, `focused` on <a> tag. Remove these props from the element. 

显然,这些道具都不是我提供的,所以我认为它可能与依赖项的版本有关。

我怎样才能解决这个问题?

标签: javascriptreactjsbootstrap-4react-bootstrap

解决方案


推荐阅读