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