refactor: add pragmaFrag config
This commit is contained in:
parent
10caee7380
commit
6e718c0ae6
|
@ -148,7 +148,9 @@ module.exports = {
|
|||
[
|
||||
"@babel/preset-react",
|
||||
{
|
||||
"pragma": "h"
|
||||
"pragma": "Preact.h", // default pragma is React.createElement
|
||||
"pragmaFrag": "Preact.Fragment", // default is React.Fragment
|
||||
"throwIfNamespace": false // defaults to true
|
||||
}
|
||||
]
|
||||
],
|
||||
|
|
|
@ -182,7 +182,9 @@ module.exports = {
|
|||
[
|
||||
"@babel/preset-react",
|
||||
{
|
||||
"pragma": "h"
|
||||
"pragma": "Preact.h", // default pragma is React.createElement
|
||||
"pragmaFrag": "Preact.Fragment", // default is React.Fragment
|
||||
"throwIfNamespace": false // defaults to true
|
||||
}
|
||||
]
|
||||
],
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import { render, h } from 'preact'
|
||||
import * as Preact from 'preact'
|
||||
|
||||
import './preact-css'
|
||||
|
||||
|
||||
function Counter() {
|
||||
|
||||
return (
|
||||
|
||||
<div>Hello Preact X</div>
|
||||
|
||||
<>
|
||||
<div>Hello Preact X</div>
|
||||
<div>Hello Preact CSS</div>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
render(<Counter />, document.querySelector('#root'))
|
||||
Preact.render(<Counter />, document.querySelector('#root'))
|
||||
|
|
Loading…
Reference in New Issue