August 2025
Intermediate to advanced
270 pages
6h 16m
English
Next, create a new Stimulus controller by running the following command from the rails directory:
| | bin/rails generate stimulus bridge/button |
This creates a new file at app/javascript/controllers/bridge/button_controller.js. Remember, the nested bridge directory helps us separate web-only Stimulus controllers from bridge components.
Open the controller and replace the import statements with those from the newly added JavaScript library. Also, change the base class to BridgeComponent.
| » | import { BridgeComponent } from "@hotwired/hotwire-native-bridge" |
| | |
| » | export default class extends BridgeComponent { |
| | } |
Next, set the component’s identifier ...
Read now
Unlock full access