Skip to content
Snippets Groups Projects

Resolve #3407970 "Jsx debug expects"

1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -35,7 +35,7 @@ class JsxDebugUtility {
/**
* Associates custom elements rendered by the JSX engine to debug data.
*
* @param array $value
* @param array|object $value
* The custom element render array.
* @param $filename
* The file name of the template being rendered.
@@ -43,7 +43,8 @@ class JsxDebugUtility {
* A unique ID for associating this element with a debug data available
* in JavaScript.
*/
static public function addJsxDebugInfo(array &$value, string $filename, string $uuid): void {
static public function addJsxDebugInfo(array|object &$value, string $filename, string $uuid): void {
$value = (array) $value;
$value['data-drupal-prop-info'] = $uuid;
$value['data-drupal-jsx-template'] = $filename;
}
Loading