Skip to content

Commit 8615407

Browse files
committed
add back __props variable for BC breack reasons
1 parent 8ca08d4 commit 8615407

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/TwigComponent/src/ComponentRenderer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ private function preRender(MountedComponent $mounted, array $context = []): PreR
107107
{
108108
$component = $mounted->getComponent();
109109
$metadata = $this->factory->metadataFor($mounted->getName());
110+
$classProps = iterator_to_array($this->exposedVariables($component, $metadata->isPublicPropsExposed()));
110111
// expose public properties and properties marked with ExposeInTemplate attribute
111-
$props = array_merge($mounted->getInputProps(), iterator_to_array($this->exposedVariables($component, $metadata->isPublicPropsExposed())));
112+
$props = array_merge($mounted->getInputProps(), $classProps);
112113
$variables = array_merge(
113114
// first so values can be overridden
114115
$context,
@@ -122,6 +123,8 @@ private function preRender(MountedComponent $mounted, array $context = []): PreR
122123
// add computed properties proxy
123124
['computed' => new ComputedPropertiesProxy($component)],
124125
$props,
126+
// keep this line for BC break reasons
127+
['__props' => $classProps],
125128
// add attributes
126129
[$metadata->getAttributesVar() => $mounted->getAttributes()],
127130
);

0 commit comments

Comments
 (0)