dev
pages-keywords dev
react 용 웹에디터 - flyeditor

flyeditor

flyeditor 는 ``React`` 환경에서 간편하게 사용할 수 있는 위지윅(WYSIWYG) 웹에디터 컴포넌트입니다.




설치

  1. npm i flyeditor


기본 사용법

  1. import React, { useState } from 'react';
  2. import FlyEditor from 'flyeditor';
  3. import 'flyeditor/dist/flyeditor.css';

  4. const MyEditor = () => {
  5. const [initContent, setInitContent] = useState('<p>안녕하세요!</p>');
  6. const [content, setContent] = useState('');
  7. const [isEditable, setIsEditable] = useState(true);

  8. return (
  9. <div className="my-container">
  10. <FlyEditor
  11. value={initContent}
  12. editable={isEditable}
  13. onChange={setContent}
  14. />
  15. </div>
  16. );
  17. };

  18. export default MyEditor;


어 설정

  1. import { FlyView } from 'flyeditor';
  2. import 'flyeditor/dist/flyeditor.css';
  3. ...

  4. const MyViewer = () => {

  5. const [dbContent, setDbContent] = useState('');

  6. useEffect(()=>{
  7. // 예시: 서버 데이터 조회 API 호출
  8. const res = await api.getContent();
  9. setDbContent(res);
  10. }, [])

  11. return (
  12. <div className="my-viewer-container">
  13. <FlyView value={dbContent} />
  14. </div>
  15. );
  16. ...

  17. }



테스트, 가이드 문서

https://flyeditor.dev/


npm 링크

https://www.npmjs.com/package/flyeditor

flyeditor
웹에디터
에디터
react webeditor
리액트용 웹에디터
react editor
리액트 에디터
리액트 웹에디터
댓글 (0)
등록된 댓글이 없습니다.