-1

I need to integrate ckeditor or any editor alike inside react native,I found documentation for reactjs but not getting exact way to how to use inside RN app.

shailzzz
  • 19
  • 2

1 Answers1

-1

try this

https://github.com/vitalyliber/react-native-ckeditor

React Native CKEditor component with no native code for React Native apps built using WebView

here is the complete code.

import CKEditor from 'react-native-ckeditor'
const App = () => {
  const [description, setdescription] = useState(`<p>The <code class=" language-php">firstOrNew</code> method, like <code class=" language-php">firstOrCreate</code> will attempt to locate a record in the database matching the given attributes. However, if a model is not found, a new model instance will be returned. Note that the model returned by <code class=" language-php">firstOrNew</code> has not yet been persisted to the database. You will need to call <code class=" language-php">save</code> manually to persist it:</p>`);
  const setFieldValue = (value) => {
    console.log(value);
  }
  return (
    <>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScrollView
          contentInsetAdjustmentBehavior="automatic"
          style={styles.scrollView}>
          <View style={styles.body}>
           
            <View style={styles.sectionContainer}>
              <CKEditor
                content={description}
                onChange={value => {
                  setFieldValue(value);
                }}
                style={{flex:1}}
              />
            </View>
          </View>
        </ScrollView>
      </SafeAreaView>
    </>
  );
};
shammi
  • 1,301
  • 1
  • 10
  • 25