Resco JavaScript Bridge: Difference between revisions

Jump to navigation Jump to search
Line 109: Line 109:
;React
;React


* JSBridge.js is not written as an ES module. As such, it cannot be imported or required by third-party libraries. If you include it as an HTML script, the global variable <code>MobileCRM</code> should be available.
* JSBridge.js is not written as an ES module. As such, it cannot be ''import''ed or ''require''d by third-party libraries. However, if you ''include'' it as an HTML script, the global variable <code>MobileCRM</code> should be available.
* This may cause problems with linter or similar tools; for example, the one within the create-react-app tool. The solution is to explain the linter or (or compiler if using typescript) that the global variable <code>MobileCRM</code> exists.
* This may cause problems with linter or similar tools; for example, the one within the create-react-app tool. The solution is to explain the linter or (or compiler if using typescript) that the global variable <code>MobileCRM</code> exists. For example: <code>const MobileCRM = window.MobileCRM;</code>
* For example: <code>const MobileCRM = window.MobileCRM;</code>


== Asynchronous approach ==
== Asynchronous approach ==

Navigation menu