React Native Webview Quill
Quill component for React Native built using
postMessage
communication and a WebView.

Installation
npm install react-native-webview-quill
to use you must set a webview provider once on your project
import {providerRegistry} from "react-native-webview-quill"
import {WebView} from 'react-native-webview-quill/src/providers/WebView/ReactNative/index';
providerRegistry.WebViewProvider = WebView
then you can use the Quill
component:
import {Quill} from 'react-native-webview-quill';
Preview

Properties
All properties are optional.
Functions
Use this.quill.reloadResources(), to force component to update content.
componentDidUpdate(prevProps, prevState){
if (prevState.delta !== this.state.delta)
this.quill.reloadResources()
}
<Quill
ref={(quill) => { this.quill = quill }}
content={ this.state.delta } />
Example Usage
This example is typescript, though the library works with plain javascript as well.
import * as React from 'react';
import { StatusBar, View } from 'react-native';
import { DeltaStatic, providerRegistry, Quill } from 'react-native-webview-quill';
import { WebView } from 'react-native-webview-quill/src/providers/WebView/ReactNative/index';
providerRegistry.WebViewProvider = WebView;
const defaultOps: DeltaStatic = {
ops: [
{
insert: 'Test',
attributes: {
bold: true,
},
},
],
};
export default class App extends React.Component<{}, { content: DeltaStatic }> {
constructor(props: any) {
super(props);
this.state = {
content: defaultOps,
};
}
public render() {
return (
<View style={{ flex: 1 }}>
<View style={{ height: StatusBar.currentHeight }} />
<Quill
content={
/* the initial content */
this.state.content
}
onContentChange={
/* Callend when an edit is made */
this.onContentChange
}
containerStyle={
/*The style passed to the editor container*/
{ flex: 1 }
}
/>
</View>
);
}
private onContentChange = (content: DeltaStatic) => {
this.setState({ content });
};
}