Ref handle for the NoteEditor component.
Use this ref to imperatively control the NoteEditor from a parent component, such as triggering a save from a custom header.
import { NoteEditor, type NoteEditorRef } from '@hiyve/react-notes';function NotesPanel() { const noteEditorRef = useRef<NoteEditorRef>(null); return ( <Box> <Box sx={{ display: 'flex', justifyContent: 'space-between' }}> <Typography>Notes</Typography> <IconButton onClick={() => noteEditorRef.current?.save()} disabled={noteEditorRef.current?.isSaving || !noteEditorRef.current?.hasUnsavedChanges} > <SaveIcon /> </IconButton> </Box> <NoteEditor ref={noteEditorRef} enableAutoSave /> </Box> );} Copy
import { NoteEditor, type NoteEditorRef } from '@hiyve/react-notes';function NotesPanel() { const noteEditorRef = useRef<NoteEditorRef>(null); return ( <Box> <Box sx={{ display: 'flex', justifyContent: 'space-between' }}> <Typography>Notes</Typography> <IconButton onClick={() => noteEditorRef.current?.save()} disabled={noteEditorRef.current?.isSaving || !noteEditorRef.current?.hasUnsavedChanges} > <SaveIcon /> </IconButton> </Box> <NoteEditor ref={noteEditorRef} enableAutoSave /> </Box> );}
Current file ID (null if not yet saved)
Whether there are unsaved changes
Whether a save is in progress
Last successful save timestamp
Manually trigger a save, returns file ID
Ref handle for the NoteEditor component.
Remarks
Use this ref to imperatively control the NoteEditor from a parent component, such as triggering a save from a custom header.
Example