framework: Can't use @class on nested anonymous component

  • Laravel Version: 9.18.0
  • PHP Version: 8.1.7
  • Database Driver & Version: MySQL (not relevant)

Description:

When using @class in Blade, on an anonymous, nested component, it does not pick up the component and renders <x-icon></x-icon>, without any processing.

Steps To Reproduce:

https://github.com/bram-pkg/class-directive-bug

Use @class on a component, results in the component not rendering as the contents of that component, but just the raw tag. In this case <x-icon/>

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

That works as a temporary fix, thank you.

A workaround is to use:

<x-icon :class="Arr::toCssClasses(['...'])" />