0.3.11 • Published 3 months ago
fo-editor-react v0.3.11
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
3 months ago
0.3.10
4 months ago
0.3.9
6 months ago
0.3.8
7 months ago
0.3.7
7 months ago
0.3.6
8 months ago
0.3.5
8 months ago
0.3.2
8 months ago
0.3.4
8 months ago
0.3.3
8 months ago
0.1.22
9 months ago
0.2.3-0.2.4-alpha.4.0
9 months ago
0.1.24
9 months ago
0.3.0
8 months ago
0.2.1
9 months ago
0.2.7
9 months ago
0.1.18
10 months ago
0.2.8
9 months ago
0.1.19
9 months ago
0.2.3
9 months ago
0.3.1
8 months ago
0.2.5
9 months ago
0.2.4
9 months ago
0.1.16
10 months ago
0.1.12
10 months ago
0.1.13
10 months ago
0.1.14
10 months ago
0.1.15
10 months ago
0.1.10
11 months ago
0.1.8
11 months ago
0.1.7
11 months ago
0.0.7
1 year ago
0.0.7-alpha.0
1 year ago