From ba953aaa9175470fe9412b00b0ba6a8a74f78e08 Mon Sep 17 00:00:00 2001 From: Tim Lai Date: Sun, 12 Apr 2020 19:36:11 -0700 Subject: [PATCH] docs: update plugin api component for failSilently (#5953) --- docs/customization/plugin-api.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/customization/plugin-api.md b/docs/customization/plugin-api.md index 03294f7a..eaad076f 100644 --- a/docs/customization/plugin-api.md +++ b/docs/customization/plugin-api.md @@ -214,6 +214,13 @@ const NeverShowInfoPlugin = function(system) { } ``` +You can use `config.failSilently` if you don't want a warning when a component doesn't exist in the system. + +Be mindful of `getComponent` arguments order. In the example below, the boolean `false` refers to presence of a container, and the 3rd argument is the config object used to suppress the missing component warning. +```javascript +const thisVariableWillBeNull = getComponent("not_real", false, { failSilently: true }) +``` + #### Wrap-Actions Wrap Actions allow you to override the behavior of an action in the system.