Check out example codes for "setOnClickListener example kotlin". It will help you in understanding the concepts better.

Code Example 1

// set on-click listener
btn_click_me.setOnClickListener {
    Toast.makeText(this, "You clicked me.", Toast.LENGTH_SHORT).show()
}

Learn ReactJs, React Native from akashmittal.com