JavaScript Usage
Use the generated JavaScript API after native delegate registration is complete.
Import and call methods
Example screen usage
Best practices
- Keep JS method names aligned with actual native destinations.
- Pass stable, explicit params (
userId, IDs, flags) rather than derived UI state. - Add runtime guards in app startup so delegate registration always happens first.
When to run codegen again
Rerun codegen if any of these change:
- Method names
- Method parameters
- Method return types
Common errors
undefined is not a functionon method call: method was changed in spec, but app was not regenerated/rebuilt.- Native crash on method call: delegate was not registered before JS usage.
- Method exists but does nothing: native delegate method was generated but not implemented in host app.
