I am trying to use Atlaskit Editor in the React project. I have managed to add it using below code.
import { useState } from 'react';
import { Editor } from '@atlaskit/editor-core';
import { WikiMarkupTransformer } from '@atlaskit/editor-wikimarkup-transformer';
const Text = () => {
const [markupDocument, setMarkupDocument] = useState(false);
const onChange = (editorView: EditorView) => {
const transformer = new WikiMarkupTransformer();
const wikimarkupString = transformer.encode(editorView.state.doc);
setMarkupDocument(wikimarkupString)
};
return (
<div className="App">
<Editor
appearance="comment"
allowStatus={true}
placeholder="What do you want to say?"
shouldFocus={true}
allowTextColor={true}
allowAnalyticsGASV3={true}
allowLayouts={true}
allowExtension={true}
allowIndentation={true}
allowRule={true}
allowTables={{
allowColumnResizing: true,
allowMergeCells: true,
allowNumberColumn: true,
allowBackgroundColor: true,
allowHeaderRow: true,
allowHeaderColumn: true,
permittedLayouts: 'all',
}}
allowDate={true}
onChange={onChange}
/>
<span></span>
<pre>{markupDocument}</pre>
</div>
);
}
export default Text;
But the problem is that I am getting a lot of warnings in the console log and unable to find any documentation or examples how to remove these warnings.
It would be a great help if someone can help with this.
