React Native component used to provide the features of pass different context menu items and events
npm install @vandrei977/react-native-selectable-textThis is the updated version of @astrocoders/react-native-selectable-text.


``javascript
import { SelectableText } from "@alentoma/react-native-selectable-text";
// Use normally, it is a drop-in replacement for react-native/Text
/*
Called when the user taps in a item of the selection menu:
- eventType: (string) is the label
- content: (string) the selected text portion
- selectionStart: (int) is the start position of the selected text
- selectionEnd: (int) is the end position of the selected text
*/
onSelection={({ eventType, content, selectionStart, selectionEnd }) => {}}
value="I crave star damage"
/>;
`
$ npm install @alentoma/react-native-selectable-text --save
Create react-native.config.js in the root directory and execlude @alentoma/react-native-selectable-text from linking
`
module.exports = {
dependencies: {
"@alentoma/react-native-selectable-text": {
platforms: {
android: null // disable Android platform, other platforms will still autolink if provided,
ios: null // disable IOS platform, other platforms will still autolink if provided
}
}
}
}
`
#### iOS - Binary Linking (Alternative 1)
1. In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]node_modules
2. Go to ➜ @alentoma/react-native-selectable-text and add RNSelectableText.xcodeprojlibRNSelectableText.a
3. In XCode, in the project navigator, select your project. Add to your project's Build Phases ➜ Link Binary With LibrariesCmd+R
4. Run your project ()<
#### iOS - Pods (Alternative 2)
1. Add pod 'RNSelectableText', :path => '../node_modules/@alentoma/react-native-selectable-text/ios/RNSelectableText.podspec' to your projects podfilepod install
2. run
#### Android
1. Open up android/app/src/main/java/[...]/MainActivity.java
- Add import com.alentoma.selectabletext.RNSelectableTextPackage; to the imports at the top of the filenew RNSelectableTextPackage()
- Add to the list returned by the getPackages() method
2. Append the following lines to android/settings.gradle:`
`
include ':react-native-selectable-text'
project(':react-native-selectable-text').projectDir = new File(rootProject.projectDir, '../node_modules/@alentoma/react-native-selectable-text/android')
android/app/build.gradle
3. Insert the following lines inside the dependencies block in :`
`
implementation project(':react-native-selectable-text')