dagitab
dagitab

Reputation: 133

Error in using react-bootstrap

I'm using React-bootstrap package on my Keystone.JS project. To test I tried putting a button in my index page. However, I get the following warning:

Warning: Unknown props bsStyle, active, block, navItem, navDropdown, bsClass on tag. Remove these props from the element.

This is the code where I use Button:

var React = require('react');
var Layout = require('../../layouts/defaultLayout');
var ReactDOMServer = require('react-dom/server');
var Button = require('react-bootstrap').Button;

module.exports = React.createClass({
    render: function () {
        return (
            <Button bsStyle="primary">Default button</Button>
        );
    }
});

What am I missing? Thanks for the help.

Upvotes: 1

Views: 2256

Answers (1)

Yury Tarabanko
Yury Tarabanko

Reputation: 45106

Long story short

Many component libraries (including react-bootstrap see issue) were relying on passing custom properties to DOM elements w/o data- prefix.

Starting 15.2.0 React warns about unknown properties on DOM element

Add warning for unknown properties on DOM elements. (@jimfb in #6800, @gm758 in #7152)

You need to update library. This was fixed in v0.30.0-rc.1.

Upvotes: 2

Related Questions