editor
View in MarkdownSourceAn app state of the editor.
You can obtain the editor state and integrate it with React components.
Data Structure
- Name
- changed
- Type
- boolean
- Description
- trueif the note has been changed. The editor will save the note if- changedis true when it is closed.
 
- Name
- needsUpdatingDate
- Type
- boolean
- Description
- Whether the note's - updatedAtfield needs to be updated or not.
 
- Name
- viewMode
- Type
- 'preview' | 'sideBySide' | 'edit'
- Description
- The editor view mode which represents either - 'preview',- 'sideBySide'or- 'edit'.
 
- Name
- openingNoteId
- Type
- string | undefined
- Description
- When the app is trying to open a note, it indicates its' note ID, otherwise - undefined.
 
- Name
- readOnly
- Type
- boolean
- Description
- true if the editor is in read only mode. 
 
- Name
- savingNoteId
- Type
- string | undefined
- Description
- When the app is saving the note, it indicates its' note ID, otherwise will be - undefined.
 
- Name
- lastError
- Type
- AssistiveError | undefined
- Description
- The last error that occurred. 
 
Get the editor state manually:
const { editor } = inkdrop.store.getState()
Connect the state with your React component:
import { useSelector } from 'react-redux'
const selector = ({ editor }) => editor
const MyComponent = props => {
  const editor = useSelector(selector)
  // render
}