The recommended way to develop react-native-material-palette
is by cloning the repository and symlinking it to a project using yarn link
or npm link
.
Follow the steps below in order to setup react-native-material-palette
for development:
- Clone the repository:
$ git clone https://github.com/callstack-io/react-native-material-palette.git
- Install dependencies:
$ yarn # or `npm install`
- Link the module:
$ yarn link # or `npm link`
- Navigate to the example app:
cd example
- Install example app dependencies:
$ yarn # or `npm install`
- Link
react-native-material-palette
within the example app:
$ yarn link react-native-material-palette # or `npm link react-native-material-palette`
Done. Everything is set up aleady. Run yarn run haul -- --platform android
to start the development server and react-native run-android
to build and start the app.
- (Optional) Create a React Native project and navigate to it:
$ react-native init MyProject && cd MyProject
- Link
react-native-material-palette
within the project:
$ yarn link react-native-material-palette # or `npm link react-native-material-palette`
- Perform first time setup, if you haven't done it before. Instructions can be found here: Setup guide.
- Watch
react-native-material-palette
repository and automatically transpile changed files:
$ yarn run build:watch # or `npm run build:watch`
- Lint the files and apply automatic fixes:
$ yarn run format # or `npm run format`
- Type check the files
$ yarn run flow # or `npm run flow`
- Run tests
$ yarn run jest # or `npm run jest`
- Lint the files, type check them and run test concurently:
$ yarn run test # or `npm run test`
This error might happen if you're using haul
and have react-native-material-palette
symlinked via yarn link
or npm link
. In order to fix it, you need to overwrite webpack.haul.js
and set resolve.symlinks
to false
:
- module.exports = ({ platform }) => ({
+ module.exports = ({ platform }, defaults) => ({
+ ...defaults,
entry: `./index.${platform}.js`,
+ resolve: {
+ ...defaults.resolve,
+ symlinks: false
+ }
});
This error happens when you made some kotlin changes in the library and attempt to rebuild the example project. To fix that, run yarn run build:android
from within the example
folder.