Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect cyclic dependency imports in react native?

Is there any package or solution to detect cyclic dependency imports in react native?

[Or]

Can I get a stack trace for cyclic imports when running the app?

Currently the cyclic dependent imports are returning undefined values, Without telling the exact issue.

Thank you!

like image 393
Sanyasirao Mopada Avatar asked Feb 09 '18 14:02

Sanyasirao Mopada


People also ask

What is cyclic dependency in react?

Circular dependencies (also known as cyclic dependencies) occur when two or more modules reference each other. This could be a direct reference ( A -> B -> A ): JavaScript.

What is dependencies in react native?

Well, dependencies are those things that you need to install and import for doing specific things, for example, if you want to add routing(moving from one page to another which changes your URL) in your react project then you need to install react-router-dom dependency by doing npm install react-router-dom.

What is cyclic dependency in C++?

Circular Dependencies in C++ Its goal is to draw the “include” dependencies between classes in a C++ project. In particular, it allows to detect circular dependencies very easily or to check the architecture of a project.


1 Answers

one simple solution is using madge package to check the circular dependencies in any javascript project.

run the below command in project folder

madge --circular --extensions js app/

like image 168
Manikanta C.S.E Avatar answered Sep 18 '22 15:09

Manikanta C.S.E