Home > front end >  The react - the bootstrap, cannot use bsStyle properties
The react - the bootstrap, cannot use bsStyle properties

Time:12-11

So don't search to this error, really only I encounter this problem:
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
 

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 down

CodePudding 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/           
  • Related