kristerkari / react-native-svg-transformer

Import SVG files in your React Native project the same way that you would in a Web application.
MIT License
1.59k stars 115 forks source link

Docs: why shall we not put the declarations.d.ts on the project root folder #195

Closed soullivaneuh closed 2 years ago

soullivaneuh commented 2 years ago

This issue is a documentation details request.

On the Using TypeScript section of the readme, it says about the declarations.d.ts file:

create one if you don't have one already, but don't put in the root folder of your project

The question is: Why should I not?

We don't have any explanation neither source of the reason, and we didn't find anything on the Internet.

Also, we tried to put the declarations.d.ts file on the root folder of our Expo project and it works fine without visible side effect.

May you please provide some references about that?

Thanks!

kristerkari commented 2 years ago

I don't know the exact reason, it was added here: https://github.com/kristerkari/react-native-svg-transformer/pull/109

austingayler commented 2 years ago

Agree, this is quite a strange comment

soullivaneuh commented 2 years ago

@kristerkari Well, apparently this come from https://github.com/kristerkari/react-native-svg-transformer/issues/6#issuecomment-705549123

But we don't have any explanation of how this fix the original issue and where we should put it instead.

In my opinion, this shouldn't have been merged without strong explanation.

Also, as said before, I tested with this file on the root project, everything works as expected. Maybe an old and resolved Expo bug?

I suggest to revert this documentation change that provide nothing more than confusion.

cc @christophby, may you please add your input on that? Thanks!

christophby commented 2 years ago

Good question. Tbh I don't remember the reason for this, sorry. Maybe it was just a hickup with the TypeScript version back then. So if you don't see any issues adding the file to the root, feel free to do so :)

kristerkari commented 2 years ago

Alright, let's just fix the documentation not to mention it.

kristerkari commented 2 years ago

Could someone please review: https://github.com/kristerkari/react-native-svg-transformer/pull/206