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 fe012c7 commit f590c7fCopy full SHA for f590c7f
1 file changed
src/Forms/Container.php
@@ -290,6 +290,10 @@ public function addComponent(
290
?string $insertBefore = null,
291
): static
292
{
293
+ if (!$component instanceof Control && !$component instanceof self) {
294
+ throw new Nette\InvalidStateException("Component '$name' of type " . get_debug_type($component) . ' is not intended to be used in the form.');
295
+ }
296
+
297
parent::addComponent($component, $name, $insertBefore);
298
$this->currentGroup?->add($component);
299
return $this;
0 commit comments