Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/TwigComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,8 @@ The following code won't work as expected::

public function mount(): void
{
{# ❌ this won't work: at this point $type still has its default value.
Passed values are not yet available in props. #}
// ❌ this won't work: at this point $type still has its default value.
// Passed values are not yet available in props.
if ('error' === $this->type) {
// ...
}
Expand All @@ -493,8 +493,8 @@ untyped and has no default). If you need a prop's value, declare a parameter in

public function mount(string $type): void
{
{# ✅ this works as expected: the $type argument in PHP has the value
passed to the 'type' prop in the Twig template #}
// ✅ this works as expected: the $type argument in PHP has the value
// passed to the 'type' prop in the Twig template
if ('error' === $type) {
// ...
}
Expand Down