2

Let's say I just recently installed react-native-gifted-chat from npm, and I realized there is another package inside it, how do I access uuid package in that package?

this is inside my node_module folder:

This is inside my node_modules folder

Regularly we just do import ... from 'react-native-gifted-chat', to access package but how to access uuid package inside react-native-gifted-chat without installing uuid package?

2 Answers 2

7

The question is: Why do you want this?

I believe that the correct approach should be to depend on uuid directly, if you actually depend on it.

There is no guarantee that future versions of react-native-gifted-chat will depend on uuid, or depend on a version that has the same interface you're expecting.

Also, I believe that npm makes some effort to deduplicate the same versions of packages depended on by multiple things, so you shouldn't concern yourself overly about disk space.

Sign up to request clarification or add additional context in comments.

Comments

1

well, I think the best way is to install the wanted packages as new separate packages with npm, because maybe in the future, the devs of react-native-gifted-chat may stop depending on that package, and you will get errors that may drive you crazy before realizing the mistake you have done, so you better install uuid as a new dependency in your project so you will never have to worry about it being removed from react-native-gifted-chat.

Hope i was clear, thanks

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.