I am developing a ui button pack for a native reaction. I am trying to create a sample project to test this button. The directory structure is as follows:
my-button/
package.json
index.js
example/
package.json
index.js
I am trying to use npm link:
cd my-button
npm link
cd example
npm link my-button
In example/node_modules/I see a symbolic link to my button, VSCode can also automatically exit in the button package.
But in the sample application example, an error message appears:
Unable to resolve module my-button ...
Module does not exist in the module map or in these directories: ...
But the path in the error message is correct.
Not sure where I was wrong, or React-Native has any special way to handle the local link dependency?
I also tried npm install file:../.. This way it works great, but it's not easy to update the dependency in example/after I edited my button.