How can I set a data binding image property through the names of one of its values in React Native?

Right now, the documentation (https://rive.app/docs/runtimes/data-binding#react-native-9) does not seem to make it clear how you can set an image property through the property’s value.

For example, If I have an image property called “hat” with potential values of “hat00”, “hat01”, and “hat02” that are each responsible for rendering a different data-bound hat on the Rive, how would I be able to show a hat through code by passing in a value of “hat02”? I’m attaching an image to show the property I’m talking about.


Right now, I am able to explicitly render the hat by calling vmi.imageProperty(HAT_PROPERTY_NAME)?.set(hatImageRef.current), where hatImageRef.current is the bytes of the hat image which I get from RiveImages.loadFromBytesAsync. But it seems that it would be much simpler to use the “hat02” value if this is something that can be done. Is something like this possible through the React Native runtime? Any advice is appreciated.