We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e114f3d commit f50902eCopy full SHA for f50902e
src/Forms/Container.php
@@ -275,6 +275,10 @@ public function addComponent(
275
?string $name,
276
?string $insertBefore = null,
277
): static {
278
+ if (!$component instanceof Control && !$component instanceof self) {
279
+ throw new Nette\InvalidStateException("Component '$name' of type " . gettype($component) . ' is not intended to be used in the form.');
280
+ }
281
+
282
parent::addComponent($component, $name, $insertBefore);
283
if ($this->currentGroup !== null) {
284
$this->currentGroup->add($component);
0 commit comments