Closed dattebayorob closed 5 years ago
Hi there. Thanks for reporting this issue. I'm hoping you can provide me with a little more details, because I'm a little confused as to the decorator part of the issue? I don't see any decorators in any of the linked commits.
Ops, I'm sorry, herehere
In my case, the Router Props on .d.ts arent generated when a component decorated is exported.
The rollup-plugin-typescript2 ignores decorators on type definitionss, and generate .d.ts with the props Interface only.
Ops, I'm sorry, herehere
I still don't see any decorators 🙂 But I do see the export being assigned to the result of wrapping it in a function invocation. I'll look into it and set up a test case.
Oh, thanks, in react ecosystem I know HOCs as decorator / annotations even in functional components that doesn't accept experimentalDecorators, sorry for the confusion
@withRouter()
class Component{}
withRouter(() =>{})
When a component wrapped by a decorator is exported, rollup-plugin-ts cant generate de .d.ts interface . I noticed it with mobx-react observer, but with others decorator as well will reproduce same issue.
Here I created a component using withRouter from react-router-dom, and the output of index.d.ts is:
When exporting component without decorators, rollup-plugin-ts recognize types
rollup-plugin-ts version: 1.1.73 I'm using tsdx, let me now if this is the wrong place to report it.