(It broke ours and caused React to throw Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in. from inside react-dom, and it was very difficult to narrow down the cause to react-bootstrap-daterangepicker.)
If the change was intentional, then it's my opinion that you should:
Bump to 4.x because the API surface has changed in a breaking way
Also release a 3.4.1 that reverts this as not to break existing apps out there that rely on ^3.x
Or, if this had been the intended behavior all along, then
Use React.children.only
This would give more meaningful error message Uncaught Error: React.Children.only expected to receive a single React element child. that is thrown from inside the component's render method.
Also update the docs to mention that this is a requirement
In 3.4.0 (specifically in https://github.com/skratchdot/react-bootstrap-daterangepicker/commit/7e0e2f7297f12eec90e69a32024065d1d3efbb8e) a change was made and now there is an assumption that the component will only have a single child node. This can break existing apps that have used more than one child node.
(It broke ours and caused React to throw
Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
from insidereact-dom
, and it was very difficult to narrow down the cause toreact-bootstrap-daterangepicker
.)If the change was intentional, then it's my opinion that you should:
Or, if this had been the intended behavior all along, then
Uncaught Error: React.Children.only expected to receive a single React element child.
that is thrown from inside the component'srender
method.