1.0.3 • Published 6 years ago
react-native-emotion v1.0.3
react-native-emotion
Getting started
$ npm install react-native-emotion --save
Mostly automatic installation
$ react-native link react-native-emotion
Manual installation
iOS
- In XCode, in the project navigator, right click
Libraries➜Add Files to [your project's name] - Go to
node_modules➜react-native-emotionand addRNEmotion.xcodeproj - In XCode, in the project navigator, select your project. Add
libRNEmotion.ato your project'sBuild Phases➜Link Binary With Libraries - Run your project (
Cmd+R)<
pod
pod 'react-native-emotion', :path => './node_modules/react-native-emotion'pod installorpod update --verbose --no-repo-update
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.rn.emotion.RNEmotionPackage;to the imports at the top of the file - Add
new RNEmotionPackage()to the list returned by thegetPackages()method
- Append the following lines to
android/settings.gradle:include ':react-native-emotion' project(':react-native-emotion').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-emotion/android') - Insert the following lines inside the dependencies block in
android/app/build.gradle:compile project(':react-native-emotion')
Windows
- In Visual Studio add the
RNEmotion.slninnode_modules/react-native-emotion/windows/RNEmotion.slnfolder to their solution, reference from their app. - Open up your
MainPage.csapp
- Add
using Emotion.RNEmotion;to the usings at the top of the file - Add
new RNEmotionPackage()to theList<IReactPackage>returned by thePackagesmethod
Usage
import {EmotionView} from 'react-native-emotion';
<EmotionView
style={{ width: 200, height: 100 }}
text={"表情[微笑][撇嘴][色][发呆]"}
/>