react-native-some-string-library
Getting started
-
Automatic installation and link
$ react-native install react-native-some-string-library
-
Add package
$ npm install react-native-some-string-library --save
OR$ yarn add react-native-some-string-library
Mostly automatic installation
-
Link
$ react-native link react-native-some-string-library
-
Unlink
$ react-native unlink react-native-some-string-library
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-some-string-library
and addRNSomeStringLibrary.xcodeproj
- In XCode, in the project navigator, select your project. Add
libRNSomeStringLibrary.a
to your project'sBuild Phases
➜Link Binary With Libraries
- Run your project (
Cmd+R
)<
Android
- Open up
android/app/src/main/java/[...]/MainActivity.java
- Add
import com.reactlibrary.RNSomeStringLibraryPackage;
to the imports at the top of the file - Add
new RNSomeStringLibraryPackage()
to the list returned by thegetPackages()
method
- Append the following lines to
android/settings.gradle
:include ':react-native-some-string-library' project(':react-native-some-string-library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-some-string-library/android')
- Insert the following lines inside the dependencies block in
android/app/build.gradle
:compile project(':react-native-some-string-library')
Use
; // Put value and call back dataRNSomeStringLibrary; // Check string or numberRNSomeStringLibrary ; // Get info, get some type valueMyCustomModule// Event listener { thisaddListener = myCustomModuleEmitter; } { thisaddListener; }
Example
;; ; const myCustomModuleEmitter = RNSomeStringLibrary; <Props> state = data: '' val: '' ; { thisaddListener = myCustomModuleEmitter; } { thisaddListener; } { const data val = thisstate; return <View style=stylescontainer> <Text style=styleswelcome>Welcome to My MyCustomModule!</Text> <TextInput style= width: 200 height: 40 borderBottomColor: 'gray' borderBottomWidth: 1 placeholder="Type..." value=val underlineColorAndroid="transparent" onChangeText= this /> <Text style=stylestext onPress= MyCustomModule > Say Hi </Text> <Text style=stylestext onPress= MyCustomModule > Check is string </Text> <Text style=stylestext onPress= MyCustomModule > Get Info </Text> <Text style=stylestext onPress= MyCustomModule > Add Event </Text> <Text>data</Text> </View> ; } const styles = StyleSheet;
License
This module is MIT licensed