Skip to content

Commit

Permalink
Updates render function tip with note about h not always being requ…
Browse files Browse the repository at this point in the history
…ired (#1774)
  • Loading branch information
betweenbrain authored and phanan committed Jan 27, 2019
1 parent d58df8c commit 882c21f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/v2/guide/render-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ new Vue({
})
```

<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>
<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>

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

Expand Down

0 comments on commit 882c21f

Please sign in to comment.