I want to create a functional component in vuejs with typescript. However, I'm not sure how to setup the generic part so that I can access my props. I have this so far:
import Vue, { FunctionalComponentOptions } from 'vue';
export default Vue.component<FunctionalComponentOptions>('MyWrapper', {
functional: true,
render: (createElement, context) => {
if (context.props['flagSet']) {
console.log('flagset');
}
return createElement('div', context.data, context.children);
}
});
The error I get for the context.props line is
Element implicitly has an 'any' type because type 'FunctionalComponentOptions<Record<string, any>, PropsDefinition<Record<string, any>>>' has no index signature.
Which I'm not sure how to resolve.