diff --git a/docs/key-topics/plugins.mdx b/docs/key-topics/plugins.mdx index d0bd6a59c..1791ddec6 100644 --- a/docs/key-topics/plugins.mdx +++ b/docs/key-topics/plugins.mdx @@ -67,7 +67,7 @@ This is the whole concept. Keep in mind that you will never need to create your The `@webiny/plugins` package always exports one ready-made instance of the `PluginsContainer`, so you never need to create it yourself. Think of it as a globally accessible singleton. We need a singleton to import plugins from other `npm` packages, and by having them all import this same package (`@webiny/plugins`), at _build time_, they will be referencing the same webpack module. This means that at _runtime_, all the external plugins will be working with this one centralized registry, and will be able to access all of your app's plugins. -```ts title="Working With Plugins in React" +```ts title="Working With Plugins in React - Register plugin" // Import the global plugins container. import { plugins } from "@webiny/plugins"; @@ -78,7 +78,9 @@ plugins.register({ alert("Hello, adventurer!"); } }); +``` +```ts title="Working With Plugins in React - Invoke plugin" // Use plugins anywhere in your application (even in 3rd party npm packages). import { plugins } from "@webiny/plugins";