Skip to content

Commit 136f459

Browse files
committed
Add note about undefined custom actions to contributor docs
1 parent 8b3871a commit 136f459

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

contributor_docs/creating_libraries.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,9 @@ function myAddonButtonClicked(){
306306
}
307307
```
308308

309-
This approach supports accessing the custom action functions in both global mode and instance mode with the same code, simplifying your code from what it otherwise may need to be.
309+
Please note that in the above example, if the user does not define `function myAddonButtonClicked()` in their code, `this._customActions.myAddonButtonClicked` will return `undefined`. This means that if you are planning to call the custom action function directly in your code, you should include an `if` statement check to make sure that `this._customActions.myAddonButtonClicked` is defined.
310+
311+
Overall, this custom actions approach supports accessing the custom action functions in both global mode and instance mode with the same code, simplifying your code from what it otherwise may need to be.
310312

311313
## Next steps
312314

0 commit comments

Comments
 (0)