Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 2.71 KB

DEVELOPMENT.md

File metadata and controls

99 lines (76 loc) · 2.71 KB

react-native-material-palette development

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:

  1. Clone the repository:
$ git clone https://github.com/callstack-io/react-native-material-palette.git
  1. Install dependencies:
$ yarn # or `npm install`
  1. Link the module:
$ yarn link # or `npm link`

Using example app

  1. Navigate to the example app:
cd example
  1. Install example app dependencies:
$ yarn # or `npm install`
  1. 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.

Custom app

  1. (Optional) Create a React Native project and navigate to it:
$ react-native init MyProject && cd MyProject
  1. Link react-native-material-palette within the project:
$ yarn link react-native-material-palette # or `npm link react-native-material-palette`
  1. Perform first time setup, if you haven't done it before. Instructions can be found here: Setup guide.

Useful react-native-material-palette scripts

  • 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`

Troubleshooting

Cannot find module react or react-native

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
+   }
});

Cannot build the example project, kotlin.KotlinNullPointerException

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.