getDelta return undefined.
Closed this issue · 5 comments
bamne123 commented
Hi Team,
I am trying to use this library, but not able to get the content as per the documentation.
Is there any other way to get the data from editor?
Regards,
Nilesh
reggie3 commented
Can you post the code you're using?
bamne123 commented
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { WebViewQuillEditor } from 'react-native-webview-quilljs';
import { Container, Button, Text } from 'native-base';
export default class RkEditor extends Component {
static navigationOptions = () => {
return {
headerTitle: 'Editor',
headerBackTitle: null,
};
};
static propTypes = {
contentToDisplay: PropTypes.object,
}
static defaultProps = {
// url: 'http://localhost:8080/uat/editor'
}
onLoadCallback = (item) => {
console.log(item);
}
_getDeltaCallback = () => {
const editor = this.webViewQuillEditor;
console.log(editor);
debugger;
}
render() {
return (
<Container style={{ flex: 1 }}>
<Container>
<WebViewQuillEditor
ref={component => (this.webViewQuillEditor = component)}
// getDeltaCallback={() => this._getDeltaCallback()}
contentToDisplay={this.props.contentToDisplay}
onLoad={this.onLoadCallback}
style={{ height: 100 }}
/>
</Container>
<Button onPress={() => this._getDeltaCallback()}>
<Text>Get Text</Text>
</Button>
</Container>
);
}
}
reggie3 commented
Your _getDeltaCallback receives an argument that contains the editor contents. Try something like this:
_getDeltaCallback = (contents) => {
const editor = this.webViewQuillEditor;
console.log(contents);
debugger;
}
reggie3 commented
Closing for inactivity
naitikpatel1990 commented
Still same issue.
i passed arguments in _getDeltaCallback but "contents" argument is undefined.