https://github.com/jopemachine-playground/rn-text-with-link
Create simple text component with hyperlink in React Native
https://github.com/jopemachine-playground/rn-text-with-link
hyperlink react-native
Last synced: 8 months ago
JSON representation
Create simple text component with hyperlink in React Native
- Host: GitHub
- URL: https://github.com/jopemachine-playground/rn-text-with-link
- Owner: jopemachine-playground
- License: mit
- Created: 2020-12-31T12:25:04.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2021-01-06T11:10:51.000Z (almost 6 years ago)
- Last Synced: 2024-04-22T12:21:06.086Z (over 2 years ago)
- Topics: hyperlink, react-native
- Language: Java
- Homepage:
- Size: 932 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rn-text-with-link

Create simple text component with hyperlink in React Native

## Install
```
npm i rn-text-with-link
```
## Example
Check [App.js](https://github.com/jopemachine/rn-text-with-link/blob/main/Example/App.js) in the Example folder.
## API
### TextWithLink
#### text: `string`
Enter text through this.
urls could be represented by like this way. `[label](url)`
Example:
```js
import TextWithLink from 'rn-text-with-link';
...
```
#### style?: `StyleProp`
Style of normal text which not contains hyperlink
#### linkStyle?: `StyleProp`
The style of hyperlink text.
#### callback?: `(url: string) => void | CallbackTable`
1) `Function` type : Callback function of onPressEvent of hyperlink.
You can simply put `!` in the url's place if you don't need to use url in your custom callback.
```js
import TextWithLink from 'rn-text-with-link';
...
const gotoSignUpScreen = () => {
...
};
...
```
2) `CallbackTable` type (Object type)
It could be useful when you want to bind a different callback function to a particular "link".
You can simply put `!` in the url's place if you don't need to use url in your custom callback.
Example:
```js
import TextWithLink from 'rn-text-with-link';
...
const handleSignIn = () => {
...
};
const gotoSignUpScreen = () => {
...
};
...
```