Skip to content

qikong233/react-native-richText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

react-native-richText

to solve emoji text in react-native

How to use

import RichText from './richText';
import { defaultEmoticonReflection } from 'emoticonReflection';
render() {
  return (
    <View>
      <RichText fontSize={17} emojiSize={17} emojiReflection={defaultEmoticonReflection} >haha [smile]</RichText>
    </View>
  );
}

Props

parameter type required description default
emoticonReg string no match emoji regular \[[^\\]]+\]
fontSize number no font size 14
emojiSize number no emoji image size 15
emojiReflection array yes text link to image source

emojiReflection

defaultEmoticonReflection = [ 
  {'[smile]': require('../../icons/emoticon/emoji-1.png')}, 
  {'[good]': require('../../icons/emoticon/emoji-2.png')}, 
]; 

About

to solve emoji text in react-native

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published