-
Notifications
You must be signed in to change notification settings - Fork 324
Dev setup for contributing to the library
If you are looking to contribute to this repository, you will first want to test your changes locally. Here is how you can do it:
- Fork the repository (ref)
- Clone your forked repository on your machine
git clone https://github.com/{github-user-id}/stream-chat-react-native.git
- Open example app
cd stream-chat-react-native;
yarn link;
cd examples/TypescriptMessaging;
yarn link stream-chat-react-native;
yarn;
npx pod-install;
npx react-native run-ios # npx react-native run-android
If you are looking to contribute to this repository, you will first want to test your changes locally. Here is how you can do it:
- Fork the repository (ref)
- Clone your forked repository on your machine
git clone https://github.com/{github-user-id}/stream-chat-react-native.git
-
If you don't have react-native app setup yet, please do so using the instructions mentioned here - https://github.com/GetStream/stream-chat-react-native#for-react-native--060-1. Make sure your app runs with
stream-chat-react-native
dependency (latest version) -
Next step is to link stream-chat-react-native dependency to locally cloned repo. Replace the
stream-chat-react-native
dependency with following:
"stream-chat-react-native": "link:../stream-chat-react-native/native-package",
"stream-chat-react-native-core": "link:../stream-chat-react-native",
Here I am assuming that the clone of stream-chat-react-native and your app are under common directory. e.g.,
-- project-dir
-- stream-chat-react-native
-- my-chat-app
- If you run your app at this point, you will run into some issues related to
dependency collision
. Since metro bundler will have node_module dependencies from yourapp
folder,stream-chat-react-native
folder andstream-chat-react-native/native-package
folder. And it doesn't know how to resolve those dependencies.
So you need to modify metro.config.js
. You can copy paste the config from this gist - https://gist.github.com/vishalnarkhede/562d3cba77b7340c49a553bbd1a31e11
Please note on line 159, we are creating a list of directories to blacklist. Following path will work if both app and stream-chat-react-native are under common parent directory:
repoDir + '/stream-chat-react-native/examples/NativeMessaging/.*',
If they are not, please do the necessary changes here.
- Next clean install your app
rm -rf node_modules
rm yarn.lock
yarn install
watchman watch-del-all
yarn start --reset-cache
And thats all!! If you make code changes in stream-chat-react-native, they should reflect in your app now :)