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 7f31bd7 commit cd35f07Copy full SHA for cd35f07
src/Forms/Container.php
@@ -274,6 +274,10 @@ public function addComponent(
274
?string $insertBefore = null,
275
): static
276
{
277
+ if (!$component instanceof Control && !$component instanceof self) {
278
+ throw new Nette\InvalidStateException("Component '$name' of type " . get_debug_type($component) . ' is not intended to be used in the form.');
279
+ }
280
+
281
parent::addComponent($component, $name, $insertBefore);
282
$this->currentGroup?->add($component);
283
return $this;
0 commit comments