ds300 / ds300/react-native-typescript-transformer

Problems with SVG or HTML files

Open
#82 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
656
Forks
47
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have a problem importing html or SVG assets. And I think the problem occurs with any files that are not JS, TS or JSON ones.

For example :
```
import htmlContent from '../Assets/test.html'
import svgContent from '../Assets/test.svg'
```

The `htmlContent` and `svgContent` variables contains the value `1` and not the content of HTML or SVG file. I had not this problem using ES6, so I think it comes from Typescript but I can't find any solution.

I am using React Native 0.55.4. Tried with a 0.57.2 project and I have the same problem.

My `rn-cli.config.js` file :

```
module.exports = {
getTransformModulePath() {
return require.resolve("react-native-typescript-transformer");
},
getSourceExts() {
return ["ts", "tsx"];
}
};
```

Thanks for any help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.