We have quite a big component library done in proptypes, and we are moving to typescript.
So when I was moving a .jsx component to be a .tsx component an imported .jsx component suddenly started throwing typing errors, there is nothing currently wrong with the imported component and I can't just rewrite it typescript as it is used everywhere and it would be more effort at the moment than worth.
to get around this I did as follows (lots of intervening code removed)
import MyReactComponent from 'path/to/component';
const FixedMyReactComponent: any = MyReactComponent;
return <FixedMyReactComponent/>
it works, my errors went away, but I find this to be irritating, I would instead like not to have to make a FixedMyReactComponent and set a type for it locally, and (as I already said) I don't want to put in the time right now to fix the fact that typescript isn't understanding my component, so instead I would like to find some way to globally tell typescript ignore type errors you get from a js / jsx and only report errors from .ts / .tsx.
I suppose it would be something like
declare module '*.jsx' {
var _: React.Component<any, any>;
export default _;
}
but that doesn't seem to have the effect I want.