@hexeo/vue-typescript-jsx

Translate React JSX props into Vue VDOM data format at runtime

Stats

StarsIssuesVersionUpdatedCreatedSize
@hexeo/vue-typescript-jsx
302.0.23 years ago4 years agoMinified + gzip package size for @hexeo/vue-typescript-jsx in KB

Readme

vue-typescript-jsx

Usage

tsconfig.json

{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "h",
  }
}
import Vue from 'vue'
import VueTSX from 'vue-typescript-jsx'

Vue.use(VueTSX)

...

Limitations

Spread/Merge props

Spread and merge of props are not supported by typescript compiler.

<div class="a" {...{class: 'b'}} />

This will not result in

{
  class: {
    a: true,
    b: true
  }
}

but in

{
  class: 'b'
}

input, textarea, options, select literal values

Literal values will be passed to domProps-value.

<input value="some value" />

will generate the following in the VDOM Data

{
  domProps: {
    value: 'some value'
  }
}

h auto-injection

There is no h auto-injection, you should provide it.

render(h: Vue.CreateElement) {
  return <div />
}
get value() {
  const h = this.$createElement
  return <div />
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.