Skip to content

[Symfony UX React] Component without props #364

@milankaranovic

Description

@milankaranovic

Hey Symfony team! Thanks for all the amazing work you did so far! 🙏🏻

"symfony/ux-react": "^2.2"

I've noticed an issue when I tried to render react component without props using the react_component twig function.

When I try to render react component like this:

<div {{ react_component('MyComponent') }}></div>

I get the following console error:
image

As you can see from the image, it renders props as an array instead an object

It works this way (without props data attribute)

<div data-controller="symfony--ux-react--react" data-symfony--ux-react--react-component-value="MyComponent"></div>

I think that props should be optional.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugBug Fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions