Closed BrianJVarley closed 3 years ago
Added a PR to fix this: https://github.com/BBKolton/reactify-wc/pull/18
This has been merged. Can you check it out?
Hey, i just tried to use this package with typescript, and it seems there is a bug again with passing Props. You still can pass them, but they are not on the types output.
Output should be something like ForwardRefExoticComponent<Props & RefAttributes>
.
Hey @BBKolton, I'm using this package in a React TypeScript project, so far it's been helpful to bridge the gap converting from a Custom Element to React component.
But something I'm not clear on is how you provide a concrete
Props
type to thereactifyWc('my-component')
call. I did see a related PR here actually to provide the Props type - https://github.com/BBKolton/reactify-wc/issues/6. But in my example below thename
,age
props are not showing in intellisense although I've provided them in theTest
interface.Could you provide some code examples of how you attach Props to a component created with
reactifyWc
? I don't see any similar examples in the README.Below is my attempt at attaching props and resulting outcome in intellisense:
Creating Component Wrapper:
Result in VsCode:
Instead of picking up the
Test
type, the IDE is picking up the component's type as'IntrinsicAttributes & RefAttributes<any>'
somehow.