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