flyeditor 1.2.2
flyeditor 1.2.2


에디터 삽입
- import React, { useState } from 'react';
- import FlyEditor from 'flyeditor';
- import 'flyeditor/dist/flyeditor.css';
- const MyEditor = () => {
- const [initContent, setInitContent] = useState('<p>안녕하세요!</p>');
- const [content, setContent] = useState('');
- const [isEditable, setIsEditable] = useState(true);
- return (
- <div className="myeditor-container">
- <FlyEditor
- value={initContent}
- editable={isEditable}
- onChange={setContent}
- />
- </div>
- );
- };
- export default MyEditor;
에디터 뷰어
- import { FlyView } from 'flyeditor';
- import 'flyeditor/dist/flyeditor.css';
- ...
- const MyViewer = () => {
- const [dbContent, setDbContent] = useState('');
- useEffect(()=>{
- // 예시: 서버 데이터 조회 API 호출
- const res = await api.getContent();
- setDbContent(res);
- }, [])
- return (
- <div className="myviewer-container">
- <FlyView value={dbContent} />
- </div>
- );
- ...
- }
테스트 및 개발 가이드는 아래 링크에서...
https://flyeditor.dev/
flyeditor
react webeditor
리액트 웹에디터
웹에디터
webeditor
댓글 (0)
등록된 댓글이 없습니다.

