volume-react-native
React native components for Volume
Installation (NOT AVAILABLE UNTIL PACKAGE IS PUBLISHED)
npm install volume-react-native
Usage
import { HelloWorld } from 'volume-react-native';
const App = () => {
return <HelloWorld />;
};
Generate API Types
You can auto generate typescript definitions from the swagger json, dtsgenerator is a good tool for this.
Install it globally
npm i -G dtsgenerator
Run it against our api.
dtsgen --url <API_SWAGGER_URL> -o <OUTPUT_LOCATION
Example with the volumemvpkai-env, creating a file in the root directory here named volume-api.d.ts
.
dtsgen --url http://volumemvpkai-env.eba-sarhrj3y.eu-central-1.elasticbeanstalk.com/v3/api-docs -o volume-api.ts
You can then use this generated file to copy the interfaces you need/update any types we have referenced in the library.
Testing your changes with a React Native Application
It is possible to test your built changes without having to publish to npm, however you will require yalc to do this. So install that first (tldr:: npm i -G yalc
)
Workflow
First build your changes with yalc
.
In the Volume COMPONENT directory
yalc publish
Then simply add your changes to your application
In your testing APPLICATION directory
yalc add @volume/react-native
To finish in your APPLICATION
yarn
Now the package is required locally and test away, simply run yalc publish
again in the COMPONENT directory after you make any changes to see if it works!
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
Contributing Quick Start
From the project root install with yarn
yarn
Run the example app to see and test changes
yarn example <ios|android>
You can then make changes in the src/components directory and they will be live updated in the example app.
See the full contributing doc for more detailed instructions.
License
MIT