Skip to content

[ReactAdapter] Passing a JsonValue to setState should pass it to the client as it is #21514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stefanuebe opened this issue May 23, 2025 · 0 comments

Comments

@stefanuebe
Copy link
Contributor

Description of the bug

In my ReactAdapterComponent, I need a json object on the client and want to pass that from the server using setState. Unfortunately the method does not check, if the given parameter is already a valid json object and serialize it nevertheless. That results in an invalid json object on the client.

Expected behavior

Since setState does nothing else than calling setPropertyJson, it should check for the parameter and skip the serialization, if the given object can be passe directly.

It might also make sense to overhaul the JacksonUtils regarding this behavior.

Minimal reproducible example

Create a ReactAdapterComponent subclass. Use setState and pass some JsonValue.

Versions

  • Vaadin / Flow version: 24.8. alpha7
  • Java version: 17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Normal Priority (P2)
Development

No branches or pull requests

2 participants