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