Skip to content

Commit 08fe9d0

Browse files
authored
Merge pull request #108 from jviide/use-native-spread-doc
Document babel-plugin-htm's new useNativeSpread option
2 parents 526bb7b + 1533ed8 commit 08fe9d0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/babel-plugin-htm/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ By default, `babel-plugin-htm` will process all Tagged Templates with a tag func
4545

4646
`babel-plugin-htm` transforms prop spreads (`<a ...${b}>`) into `Object.assign()` calls. For browser support reasons, Babel's standard `_extends` helper is used by default. To use native `Object.assign` directly, pass `{useBuiltIns:true}`.
4747

48+
### `useNativeSpread=false`
49+
50+
`babel-plugin-htm` transforms prop spreads (`<a ...${b} x=y>`) into `{ ...b, x: 'y' }` object spread syntax. For browser support reasons, Babel's standard `_extends` helper is used by default. To use object spread syntax, pass `{useNativeSpread:true}`. This option takes precedence over the `useBuiltIns` option.
51+
4852
### `variableArity=true`
4953

5054
By default, `babel-plugin-htm` transpiles to the same output as JSX would, which assumes a target function of the form `h(type, props, ...children)`. If, for the purposes of optimization or simplification, you would like all calls to `h()` to be passed exactly 3 arguments, specify `{variableArity:false}` in your Babel config:

0 commit comments

Comments
 (0)