Fix some props issues

This commit is contained in:
2024-10-05 23:15:35 +02:00
parent 9de434ff2e
commit 6406265df6
5 changed files with 17 additions and 14 deletions

View File

@@ -7,11 +7,13 @@ import { defaultKeymap } from '@codemirror/commands';
import { oneDark } from '@codemirror/theme-one-dark';
import { useSettings } from '../contexts/SettingsContext';
const Editor = (content, handleContentChange, handleSave, selectedFile) => {
const Editor = ({ content, handleContentChange, handleSave, selectedFile }) => {
const { settings } = useSettings();
const editorRef = useRef();
const viewRef = useRef();
console.log('Editor content:', content);
useEffect(() => {
const handleEditorSave = (view) => {
handleSave(selectedFile, view.state.doc.toString());