README
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-emotion
and addRNEmotion.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNEmotion.a
to 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 install
orpod 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.sln
innode_modules/react-native-emotion/windows/RNEmotion.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using Emotion.RNEmotion;
to the usings at the top of the file - Add
new RNEmotionPackage()
to theList<IReactPackage>
returned by thePackages
method
Usage
import {EmotionView} from 'react-native-emotion';
<EmotionView
style={{ width: 200, height: 100 }}
text={"表情[微笑][撇嘴][色][发呆]"}
/>