We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please there is nowhere in the documentation that explains usage with react.js
The text was updated successfully, but these errors were encountered:
https://github.com/wangzuo/react-medium-editor
Sorry, something went wrong.
You can try this maybe:
import * as React from "react"; import MediumEditor from "medium-editor"; import "medium-editor/dist/css/medium-editor.css"; import "medium-editor/dist/css/themes/default.css"; import classNames from "classnames"; const Article: React.FC = () => { const [editor, setEditor] = React.useState<any>(); const onRefChange = React.useCallback((node) => { if (node === null) { setEditor(null) } else { if (editor == null) { const et = new MediumEditor(node); setEditor(et); } } }, []); // adjust deps return ( <div className="w-full bg-[#21212B] text-white h-[500px] overflow-y-scroll px-4 py-3"> <div className={classNames( "w-full h-full prose text-white", "prose-headings:text-white ", "prose-a:text-[#94C7E9]", "focus:outline-none" )} ref={onRefChange} ></div> </div> ); }; export default Article;
No branches or pull requests
Please there is nowhere in the documentation that explains usage with react.js
The text was updated successfully, but these errors were encountered: