How to use react-native-cn-richtext-editor - 2 common examples

To help you get started, we’ve selected a few react-native-cn-richtext-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imnapo / react-native-cn-richtext-editor / expo-demo / App.js View on Github external
constructor(props) {
        super(props);
        this.customStyles = {...defaultStyles, body: {fontSize: 12}, heading : {fontSize: 16}
        , title : {fontSize: 20}, ol : {fontSize: 12 }, ul: {fontSize: 12}, bold: {fontSize: 12, fontWeight: 'bold', color: ''}
        };  
        this.state = {
            selectedTag : 'body',
            selectedColor : 'default',
            selectedHighlight: 'default',
            colors : ['red', 'green', 'blue'],
            highlights:['yellow_hl','pink_hl', 'orange_hl', 'green_hl','purple_hl','blue_hl'],
            selectedStyles : [],
            // value: [getInitialObject()] get empty editor
            value: convertToObject('<div><p><span>This is </span><span style="font-weight: bold;">bold</span><span> and </span><span style="font-style: italic;">italic </span><span>text</span></p></div>'
            , this.customStyles)
        };
        
        this.editor = null;

    }
github imnapo / react-native-cn-richtext-editor / expo-demo / App.js View on Github external
import {
    Menu,
    MenuOptions, 
    MenuOption,
    MenuTrigger,
    MenuContext,
    MenuProvider,
    renderers
  } from 'react-native-popup-menu';

const { SlideInMenu } = renderers;

const IS_IOS = Platform.OS === 'ios';
const { width, height } = Dimensions.get('window');
const defaultStyles = getDefaultStyles();

class App extends Component {
 
    constructor(props) {
        super(props);
        this.customStyles = {...defaultStyles, body: {fontSize: 12}, heading : {fontSize: 16}
        , title : {fontSize: 20}, ol : {fontSize: 12 }, ul: {fontSize: 12}, bold: {fontSize: 12, fontWeight: 'bold', color: ''}
        };  
        this.state = {
            selectedTag : 'body',
            selectedColor : 'default',
            selectedHighlight: 'default',
            colors : ['red', 'green', 'blue'],
            highlights:['yellow_hl','pink_hl', 'orange_hl', 'green_hl','purple_hl','blue_hl'],
            selectedStyles : [],
            // value: [getInitialObject()] get empty editor

react-native-cn-richtext-editor

RichText Editor for React-Native

MIT
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis