Added pragmaFrag so terse Fragment syntax,<></>, can be used in Preact. (#9051)

This commit is contained in:
Nick Taylor 2020-07-01 09:19:33 -04:00 committed by GitHub
parent 83ba6b64c9
commit 9fc79cf034
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -1,4 +1,4 @@
import { h, Component, Fragment } from 'preact';
import { h, Component } from 'preact';
import PropTypes from 'prop-types';
import { generateMainImage } from '../actions';
import { validateFileInputs } from '../../packs/validateFileInputs';
@ -75,7 +75,7 @@ export class ArticleCoverImage extends Component {
<Spinner /> Uploading...
</span>
) : (
<Fragment>
<>
<Button variant="outlined" className="mr-2 whitespace-nowrap">
<label htmlFor="cover-image-input">{uploadLabel}</label>
<input
@ -95,7 +95,7 @@ export class ArticleCoverImage extends Component {
Remove
</Button>
)}
</Fragment>
</>
)}
</div>
{uploadError && (

View file

@ -54,6 +54,7 @@ module.exports = function (api) {
'@babel/plugin-transform-react-jsx',
{
pragma: 'h',
pragmaFrag: '"Fragment"',
},
],
].filter(Boolean),