Example-package-02
This repo contains components/utils which are shared for Corva ui apps.
Things to know:
-
yarn start
will open ExampleApp.js in your browser. That's a playground for building components. -
To link this repo with your app, you should:
- Run
yarn build
oryarn build-watch
in @corva/ui repo (only first time) - Run
npm link dist
in @corva/ui repo root (only first time) - Run
npm link @corva/ui
in your app folder
- Run
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
- Run
yarn build
oryarn build-watch
in @corva/ui repo (only first time) - Run
npm link dist
in @corva/ui repo root (only first time) - Run
npm link @corva/ui
in your app folder
Note: npm link will not install @corva/ui dependencies in your node modules folder. If you want to debug a change in @corva/ui dependencies, you should use
yarn add file:../corva-web-repo/dist
, this will install new dependencies. - Run
In case of issues with build
You may have a problem with Invalid Hook Call Warning when you link library to app/another project;
In that case, your bundler might “see” two Reacts — one in application folder and one in your library folder. Assuming myapp and mylib are sibling folders, one possible fix is to run npm link ../myapp/node_modules/react from mylib. This should make the library use the application’s React copy.