0.3.11 • Published 8 months ago

fo-editor-react v0.3.11

Weekly downloads
-
License
ISC
Repository
-
Last release
8 months ago

fo-editor-react

最新文档请移步官方地址

使用方式

有以下两种方式

方法一:组件形式集成

import React from 'react';
import { ReactEditor, ReactEditorProps } from 'fo-editor-react';

export const MyEditor = (props: ReactEditorProps) => {
  const editorRef = React.useRef<typeof ReactEditor | null>(null);
  return <ReactEditor ref={editorRef} {...props} />;
};

方法二:自定义 Hook

import React from 'react';
import { useReactEditor, ReactEditor, ReactEditorProps } from 'fo-editor-react';

export const MyEditor = (props: ReactEditorProps) => {
  const divRef = React.useRef<HTMLElement | null>(null);
  const foEditorRef = React.useRef<ReactEditor | null>(null);
  foEditorRef.current = useReactEditor(props, divRef.current);
  return <div ref={divRef}></div>;
};
0.3.11

8 months ago

0.3.10

8 months ago

0.3.9

11 months ago

0.3.8

12 months ago

0.3.7

12 months ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.2

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.1.22

1 year ago

0.1.24

1 year ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.7

1 year ago

0.1.18

1 year ago

0.2.8

1 year ago

0.1.19

1 year ago

0.2.3

1 year ago

0.3.1

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.1.16

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.10

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.0.7

2 years ago

0.0.7-alpha.0

2 years ago