August 2025
Intermediate to advanced
270 pages
6h 16m
English
The names of icons are different on iOS and Android. So, to keep the meaning of these icons consistent, we need a way to uniquely differentiate one from another.
Start by opening button_controller.js in the Rails app and update the reference to the iOS icon to distinguish it from an Android one. Then, add a second value for Android.
| | import { BridgeComponent } from "@hotwired/hotwire-native-bridge" |
| | |
| | export default class extends BridgeComponent { |
| | static component = "button" |
| | |
| | connect() { |
| | super.connect() |
| | |
| | const title = this.bridgeElement.bridgeAttribute("title") |
| » | const imageName = this.bridgeElement.bridgeAttribute( ... |
Read now
Unlock full access