Skip to content

Commit

Permalink
refactor: do not allow adding children with options passed in as a bo…
Browse files Browse the repository at this point in the history
…olean (#3872)

This has been deprecated throughout 5.0 and being removed. To include a child, you must use an object  or false to exclude it. true will no longer be supported.

BREAKING CHANGE: remove ability to add children with options as a boolean.
  • Loading branch information
brandonocasey authored and gkatsev committed Jan 18, 2017
1 parent e12bedb commit b07143d
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/js/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,6 @@ class Component {
if (typeof child === 'string') {
componentName = toTitleCase(child);

// Options can also be specified as a boolean,
// so convert to an empty object if false.
if (!options) {
options = {};
}

// Same as above, but true is deprecated so show a warning.
if (options === true) {
log.warn('Initializing a child component with `true` is deprecated.' +
'Children should be defined in an array when possible, ' +
'but if necessary use an object instead of `true`.'
);
options = {};
}

const componentClassName = options.componentClass || componentName;

// Set name through options
Expand Down

0 comments on commit b07143d

Please sign in to comment.