Skip to content

Commit 882c21f

Browse files
betweenbrainphanan
authored andcommitted
Updates render function tip with note about h not always being required (#1774)
1 parent d58df8c commit 882c21f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/v2/guide/render-function.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ new Vue({
497497
})
498498
```
499499

500-
<p class="tip">Aliasing `createElement` to `h` is a common convention you'll see in the Vue ecosystem and is actually required for JSX. If `h` is not available in the scope, your app will throw an error.</p>
500+
<p class="tip">Aliasing `createElement` to `h` is a common convention you'll see in the Vue ecosystem and is actually required for JSX. Starting with [version 3.4.0](https://github.com/vuejs/babel-plugin-transform-vue-jsx#h-auto-injection) of the Babel plugin for Vue, we automatically inject `const h = this.$createElement` in any method and getter (not functions or arrow functions), declared in ES2015 syntax that has JSX, so you can drop the `(h)` parameter. With prior versions of the plugin, your app would throw an error if `h` was not available in the scope.</p>
501501

502502
For more on how JSX maps to JavaScript, see the [usage docs](https://github.com/vuejs/jsx#installation).
503503

0 commit comments

Comments
 (0)