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