Check out example codes for "execute js from image". It will help you in understanding the concepts better.

Code Example 1

<div onclick = "ShowKeyboard()">
<img src = "' + content + '" alt ="Heads" height="170" width="170"/>
</div>

Learn ReactJs, React Native from akashmittal.com