Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type '{}' is not assignable to type '() => VNodeChild'. #2007

Closed
jahnli opened this issue Oct 13, 2022 · 9 comments
Closed

Type '{}' is not assignable to type '() => VNodeChild'. #2007

jahnli opened this issue Oct 13, 2022 · 9 comments
Labels
bug Something isn't working

Comments

@jahnli
Copy link

jahnli commented Oct 13, 2022

Type '{}' provides no match for the signature '(): VNodeChild'.

interface PropsType {
  renderSlot?: RenderSlotType;
}
const { renderSlot } = defineProps<PropsType>();

const render = () => renderSlot?.render();
</script>

<template>
  <render />
</template>

@jahnli
Copy link
Author

jahnli commented Oct 13, 2022

If it goes back to 1.0.3, it's OK

@k713927
Copy link

k713927 commented Oct 13, 2022

i has the same problem
...CopyImageVideoBar.vue:75:18 - error TS2322: Type '($event: any) => void' is not assignable to type 'MouseEvent'.

@Sky-Flare
Copy link

This is the version of "@types/node": "18.8.3", in 18.8.5 which has changed.

@cuebit
Copy link
Member

cuebit commented Oct 13, 2022

@k713927 your issue is not the same. Please refer to #1985

@Sky-Flare
Copy link

Thanks

@spacedawwwg
Copy link

spacedawwwg commented Oct 13, 2022

I've just hit this issue too. Fixed the @types/node issues by pinning to 18.0.0 but now stuck with a few Type '{}' is not assignable to type issues.

image

const Chart = {
  setup() {
    return () =>
      h(UolChart, props.componentProps, {
        default: () => h('p', props.intro),
      });
  },
};

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Oct 13, 2022
@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 13, 2022

You can use these workaround, or use v1.0.6 for now.

import { FunctionalComponent } from 'vue';

const render: FunctionalComponent = () => renderSlot?.render();
import { defineComponent } from 'vue';

const Chart = defineComponent({
  setup() {
    return () =>
      h(UolChart, props.componentProps, {
        default: () => h('p', props.intro),
      });
  },
});

@spacedawwwg
Copy link

spacedawwwg commented Oct 13, 2022

You can use these workaround, or use v1.0.6 for now.

import { FunctionalComponent } from 'vue';

const render: FunctionalComponent = () => renderSlot?.render();
import { defineComponent } from 'vue';

const Chart = defineComponent({
  setup() {
    return () =>
      h(UolChart, props.componentProps, {
        default: () => h('p', props.intro),
      });
  },
});
import type { FunctionalComponent } from 'vue';
import { h } from 'vue';

const Chart: FunctionalComponent = () =>
  h(UolChart, props.componentProps, {
    default: () => h('p', props.intro),
  });

Got me where I needed to be, thanks @johnsoncodehk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants