Warning: the React does not recognize the bsStyle prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase bsStyle home. If you accidentally passed it from a parent component, remove it from the DOM element.
Environment is the react scaffold generated
The test code is very simple.
1. Entry documents lead CSS
Import 'bootstrap/dist/CSS/bootstrap CSS'
2. Any component test & lt; Button>
The import {Button} from "the react - the bootstrap";
. In the middle to omit...
Results:
1. To display the button, but obviously not bsStyle properties take effect, no matter how change is always the default styles
Even if the delete is also true:
2. Moreover, the browser Console error
Warning: the React does not recognize the bsStyle prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase bsStyle home. If you accidentally passed it from a parent component, remove it from the DOM element.
Deny this attribute
the react
3. Change the lowercase bsstyle, of course, also didn't any effect
4. Of course, use traditional bootstrap className way, which can be normal display
So what should be how to using bsStyle like website?
To search on the net is in the public/index. The HTML inside the bootstrap various packages, is invalid, I think is not the problem.
Problem is the react didn't put the bootstrap components when the react, deny the custom propCodePudding user response:
Although there is no understand, I also turned over the source code, is used in the attribute "variant"& lt; The Button the variant="success" & gt; Click
Such use can also,
Online said without the introduction of the bootstrap styles, anyway I added no effect,
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap.min.css" & gt;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/latest/css/bootstrap-theme.min.css" & gt;CodePudding user response:
Turned out to be a version of the problem, some of the new component into will find does not exist;use NPM install [email protected] - save
Version will drop downCodePudding user response:
Update this problem, the Chinese website of the document is outdated, just don't use this paper, and the new version of the difference is very big,http://react.tgwoo.com/introduction.html
Suggestions to the website of the official view document
https://react-bootstrap.github.io/