State variable in modules not working as expected

There is a small bug with State Variables when used in modules. After initialization, regardless of what Type was chosen, the variable holds a string.

This can be easily tested like so:

  • Create new module

  • Add State Variable to new module and choose any type besides string
    image

  • Create an action that tries to use a function of the chosen type, for Array we’ll use .push()

  • Make function executable - be it as onInit trigger or trigger by button press

  • Now, when module is placed inside an app and the action is e executed, it will show these logs

Only after you manually assign the proper type, it will act as expected.

So if we change the content of the action to:

{{state.var}} = [];
{{actions.newAction2.trigger()}}

And in a second action, we check on the .push() function again:

We’ll get:

Hey @Max

Thank you for the detailed explanation. We’ll have a look.

1 Like

@Max

What is your current UI Bakery version?

Current version is On Prem v3.136.0

1 Like

Hey @Max

The fix is already available under version 3.137.2-rc.0. You can update your version now, or wait till tomorrow evening/ Thursday morning when the stable release is available.

2 Likes

HI @Max

The stable version 3.137.3 is already available, so you can try it out.

1 Like