From 13a2d6fa8d09703e93d77b2b4dba1f0571095123 Mon Sep 17 00:00:00 2001 From: Jon Surrell Date: Tue, 23 Apr 2019 14:32:48 +0200 Subject: [PATCH] Document scopeVariableFrag --- packages/babel-plugin-import-jsx-pragma/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/babel-plugin-import-jsx-pragma/README.md b/packages/babel-plugin-import-jsx-pragma/README.md index aa43bc1285dcc7..ca6d7dc2c27631 100644 --- a/packages/babel-plugin-import-jsx-pragma/README.md +++ b/packages/babel-plugin-import-jsx-pragma/README.md @@ -44,11 +44,13 @@ module.exports = { plugins: [ [ '@wordpress/babel-plugin-import-jsx-pragma', { scopeVariable: 'createElement', + scopeVariableFrag: 'Fragment', source: '@wordpress/element', isDefault: false, } ], [ '@babel/transform-react-jsx', { pragma: 'createElement', + pragmaFrag: 'Fragment', } ], ], }; @@ -60,6 +62,12 @@ _Type:_ String Name of variable required to be in scope for use by the JSX pragma. For the default pragma of React.createElement, the React variable must be within scope. +### `scopeVariableFrag` + +_Type:_ String + +Name of variable required to be in scope for `Fragment` (`<>` or ``) JSX. + ### `source` _Type:_ String @@ -70,6 +78,7 @@ The module from which the scope variable is to be imported when missing. _Type:_ Boolean -Whether the scopeVariable is the default import of the source module. +Whether the scopeVariable is the default import of the source module. Note that this has no impact +on `scopeVariableFrag`.

Code is Poetry.