Skip to content

Commit

Permalink
fix(react-bootstrap): only require needed components from react boots…
Browse files Browse the repository at this point in the history
…trap

we had to specifically call out default for dropdown because apparently:

`export default function() {}`

gives you a function when required

but something about the way react-bootstrap defines and exports Dropdown
means that the default require is a module object

[Finishes #103525664]

Signed-off-by: August Toman-Yih <atomanyih@pivotal.io>
  • Loading branch information
clairethompson committed Sep 16, 2015
1 parent 87a90a5 commit a2847f9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion spec/pivotal-ui-react/collapse/collapse_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var {TestUtils} = React.addons;
describe('BaseCollapse', function() {
var BsPanel, BaseCollapse, subject, bsPanel;
beforeEach(function() {
BsPanel = require('react-bootstrap').Panel;
BsPanel = require('react-bootstrap/lib/Panel');
BaseCollapse = require('../../../src/pivotal-ui-react/collapse/collapse').BaseCollapse;

subject = React.render((
Expand Down
2 changes: 1 addition & 1 deletion src/pivotal-ui-react/alerts/alerts.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var React = require('react');
var types = React.PropTypes;
var BsAlert = require('react-bootstrap').Alert;
var BsAlert = require('react-bootstrap/lib/Alert');
var {Media} = require('pui-react-media');

var Alert = React.createClass({
Expand Down
2 changes: 1 addition & 1 deletion src/pivotal-ui-react/collapse/collapse.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var React = require('react');
var types = React.PropTypes;
var BsPanel = require('react-bootstrap').Panel;
var BsPanel = require('react-bootstrap/lib/Panel');
import {mergeProps} from 'pui-react-helpers';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/pivotal-ui-react/dropdowns/dropdowns.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import uniqueid from 'lodash.uniqueid';
* @see [Pivotal UI React](http://styleguide.pivotal.io/react.html#dropdown_react)
* @see [Pivotal UI CSS](http://styleguide.pivotal.io/objects.html#dropdown)
*/
var BsDropdown = require('react-bootstrap').Dropdown;
var BsDropdown = require('react-bootstrap/lib/Dropdown').default;

function defDropdown(props) {
return React.createClass({
Expand Down Expand Up @@ -75,7 +75,7 @@ module.exports = {
* @see [Pivotal UI React](http://styleguide.pivotal.io/react.html#dropdown_react)
* @see [Pivotal UI CSS](http://styleguide.pivotal.io/objects.html#dropdown)
*/
DropdownItem: require('react-bootstrap').MenuItem,
DropdownItem: require('react-bootstrap/lib/MenuItem'),

/**
* @component LinkDropdown
Expand Down
4 changes: 2 additions & 2 deletions src/pivotal-ui-react/grids/grids.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var React = require('react');
var types = React.PropTypes;
var BootstrapRow = require('react-bootstrap').Row;
var BootstrapRow = require('react-bootstrap/lib/Row');
import {mergeProps} from 'pui-react-helpers';

/**
Expand Down Expand Up @@ -79,7 +79,7 @@ var Row = React.createClass({
* @see [Pivotal UI React](http://styleguide.pivotal.io/react.html#grid_react)
* @see [Pivotal UI CSS](http://styleguide.pivotal.io/layout.html#grid)
*/
var Col = require('react-bootstrap').Col;
var Col = require('react-bootstrap/lib/Col');

module.exports = {Row, Col};

Expand Down
2 changes: 1 addition & 1 deletion src/pivotal-ui-react/tooltip/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = {
*
* @see [Pivotal UI React](http://styleguide.pivotal.io/react.html#tooltips_react)
*/
Tooltip: require('react-bootstrap').Tooltip
Tooltip: require('react-bootstrap/lib/Tooltip')
};


Expand Down

0 comments on commit a2847f9

Please sign in to comment.