Skip to content

Commit

Permalink
Document scopeVariableFrag
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Apr 30, 2019
1 parent 6f5fa88 commit 13a2d6f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/babel-plugin-import-jsx-pragma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
} ],
],
};
Expand All @@ -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 `<Fragment />`) JSX.

### `source`

_Type:_ String
Expand All @@ -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`.

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>

0 comments on commit 13a2d6f

Please sign in to comment.