Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

How can I create a node module using lottie-react-native?

$
0
0

I'm building a React-Native component library.

I built a simple loader using lottie-react-native.

When installing the library locally, the component works.

After publishing the package on github and installing it, there is no error but the component is not displayed at all.

(FYI, I first encountered an issue installing it which has been resolved here : Why a dependency would not want to install when installing a library?Now, the lottie-react-native dependencies appears in my node_modules).

I think I spotted the issue but I'm not sure and I don't how to resolve it.

First have a look at the freshly installed library's folder tree in the node_modules folder:

enter image description here

At this point, the lib folder shows an error, let's open it :

enter image description here

Ok, let's open the TS folder and sub-folders until I reach the error:

enter image description here

Now the index.d.ts file containing the error:

enter image description here

Originally, the assets folders contains the json files needed for the Lottie view.

When running the publishing process, my src folder is compiled to TS and the .d files are created.

I think the issue could be due to some tsconfig options or maybe the way I import things, but I'm not sure.

Here's the folder structure in the dev environnement:

enter image description here

Since it works fine when the lib is installed locally, I'm pretty sure that the issue occurs when compiling to TS.

What do you think?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>