From d29c2cd528db675650c882e9427744adc20ff30e Mon Sep 17 00:00:00 2001 From: Marin Atanasov Date: Wed, 2 Aug 2023 11:57:52 +0300 Subject: [PATCH] Fix inline example to use private API --- packages/components/src/theme/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/components/src/theme/index.tsx b/packages/components/src/theme/index.tsx index 591da45e7c14d9..ff474ca9280c19 100644 --- a/packages/components/src/theme/index.tsx +++ b/packages/components/src/theme/index.tsx @@ -20,7 +20,15 @@ import { useCx } from '../utils'; * * @example * ```jsx - * import { __experimentalTheme as Theme } from '@wordpress/components'; + * import { privateApis as componentsPrivateApis } from '@wordpress/components'; + * import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis'; + * + * const { lock, unlock } = __dangerousOptInToUnstableAPIsOnlyForCoreModules( + * 'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', + * '@wordpress/components' + * ); + * + * const { Theme } = unlock( componentsPrivateApis ); * * const Example = () => { * return (