mirror of
https://github.com/videojs/video.js.git
synced 2025-01-27 11:22:06 +02:00
refactor: do not allow adding children with options passed in as a boolean (#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.
This commit is contained in:
parent
e12bedbb45
commit
b07143d276
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user