Java Lang Error when trying to change styles dynamically


My SDK Version is 40, and I’m testing in web and Android.

Currently, I’m trying to obtain the size of a possible unknown image via Image.getSize and change the width and height of an Image via useState and the style attribute.

No matter what I try, when I test this in web it works as expected but when I test it in my android phone or a simulator I get the error “Uncaught Error: java.lang.Double cannot be cast to java.lang.String”.

I don’t really understand what I may be doing wrong so a little help would be appreciated.

Here’s a Snack showcasing the error:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.