https://github.com/garrettmac/react-native-reddit-labs
https://github.com/garrettmac/react-native-reddit-labs
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/garrettmac/react-native-reddit-labs
- Owner: garrettmac
- Created: 2017-08-12T23:02:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-12T23:02:32.000Z (almost 9 years ago)
- Last Synced: 2024-10-06T01:23:19.198Z (almost 2 years ago)
- Language: Objective-C
- Size: 653 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# react-native-reddit-labs
## Getting started
`$ npm install react-native-reddit-labs --save`
### Mostly automatic installation
`$ react-native link react-native-reddit-labs`
### Manual installation
#### iOS
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
2. Go to `node_modules` ➜ `react-native-reddit-labs` and add `RNRedditLabs.xcodeproj`
3. In XCode, in the project navigator, select your project. Add `libRNRedditLabs.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`
4. Run your project (`Cmd+R`)<
#### Android
1. Open up `android/app/src/main/java/[...]/MainActivity.java`
- Add `import com.reactlibrary.RNRedditLabsPackage;` to the imports at the top of the file
- Add `new RNRedditLabsPackage()` to the list returned by the `getPackages()` method
2. Append the following lines to `android/settings.gradle`:
```
include ':react-native-reddit-labs'
project(':react-native-reddit-labs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-reddit-labs/android')
```
3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:
```
compile project(':react-native-reddit-labs')
```
#### Windows
[Read it! :D](https://github.com/ReactWindows/react-native)
1. In Visual Studio add the `RNRedditLabs.sln` in `node_modules/react-native-reddit-labs/windows/RNRedditLabs.sln` folder to their solution, reference from their app.
2. Open up your `MainPage.cs` app
- Add `using Com.Reactlibrary.RNRedditLabs;` to the usings at the top of the file
- Add `new RNRedditLabsPackage()` to the `List` returned by the `Packages` method
## Usage
```javascript
import RNRedditLabs from 'react-native-reddit-labs';
// TODO: What to do with the module?
RNRedditLabs;
```