mainLayout

An app state of the editor. You can obtain the mainLayout state and integrate it with React components.


Data Structure

  • Name
    distractionFreeEnabled
    Type
    boolean
    Description

    true if distraction-free mode is enabled

  • Name
    sidebarVisible
    Type
    boolean
    Description

    true if side bar is visible

Get the mainLayout state manually:

const { mainLayout } = inkdrop.store.getState()

Connect the state with your React component:

import { useSelector } from 'react-redux'
const selector = ({ mainLayout }) => mainLayout
const MyComponent = props => {
  const mainLayout = useSelector(selector)
  // render
}
Can you help us improve the docs? 🙏

The source of these docs is here on GitHub. If you see a way these docs can be improved, please fork us!