Files
landscape-template/src/Components/Inputs/TextEditor/SaveModule.tsx
MTG2000 2f9d05b8cb feat: Create story page
- topics input component
- refactor autocomplete component
- create staging slice
- fix post details username overflow
2022-06-03 22:35:31 +03:00

30 lines
737 B
TypeScript

import { useHelpers, useEvent, useRemirrorContext } from '@remirror/react';
import { Control, useController } from 'react-hook-form';
import { useDebouncedCallback } from '@react-hookz/web';
interface Props {
control?: Control,
name?: string,
}
export default function SaveModule(props: Props) {
const { field: { onChange, onBlur } } = useController({
control: props.control,
name: props.name ?? 'content'
})
const { getMarkdown, getHTML } = useHelpers();
const changeCallback = useDebouncedCallback(ctx => {
const { state } = ctx;
onChange(getHTML(state));
}, [], 500)
useRemirrorContext(changeCallback)
// useEvent('focus', () => onBlur())
return <></>
}