I am using react native with typescript. I have a component with the following structure
component
- component.ios.tsx
- component.android.tsx
Now I want to import the component. So, I am doing this:
import component from '../component/component';
But it says:
[ts] Cannot find module ../component/component
The location is correct. I need to add something to the tslint file to make it understand.
I also tried to do:
let component = require('../component/component');
This didn't give typescript error. But it gave a runtime error.
element type is invalid expected a string or a class/function but got undefined
Has anybody run into this issue? Thank you.