Composition-api: TSX: components included in render() gives ComponentRenderProxy not a constructor function for JSX elements error

Created on 9 Sep 2019  路  2Comments  路  Source: vuejs/composition-api

plugin: 0.3.0
babel-preset-vca-jsx: 0.1.0

const Child = createComponent({
  props: {
    msg: String,
  },
  setup(props) {
    return () =>
      <div>{props.msg}</div>
  },
})

const Parent = createComponent({
  setup(props) {
    return () =>
      <Child msg="Child"></Child>
  }
})

Error in VSCode:
JSX element type 'ComponentRenderProxy<ExtractPropTypes<{ msg: StringConstructor; }, true>, { [x: string]: unknown; }, ExtractPropTypes<{ msg: StringConstructor; }, false>>' is not a constructor function for JSX elements. Type 'ComponentRenderProxy<ExtractPropTypes<{ msg: StringConstructor; }, true>, { [x: string]: unknown; }, ExtractPropTypes<{ msg: StringConstructor; }, false>>' is missing the following properties from type 'ElementClass': $el, $options, $children, $scopedSlots, and 18 more.ts(2605)

Sorry, don't know how to fix this typing error. Any ideas?

enhancement

Most helpful comment

See https://github.com/vuejs/composition-api#tsx

PS:
upgrade this plugin to 0.3.1.

All 2 comments

See https://github.com/vuejs/composition-api#tsx

PS:
upgrade this plugin to 0.3.1.

@liximomo thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sapphi-red picture sapphi-red  路  4Comments

rchaser53 picture rchaser53  路  4Comments

ycmjason picture ycmjason  路  5Comments

mbbbc picture mbbbc  路  6Comments

jaryn-kubik picture jaryn-kubik  路  3Comments