Skip to content

Latest commit

 

History

History
29 lines (23 loc) · 543 Bytes

File metadata and controls

29 lines (23 loc) · 543 Bytes

Getting started

To get started with Blocks you need to install the library and then use the component in your app.

Installation

yarn add @blocks/editor

Usage

import React from 'react'
import { Editor } from '@blocks/editor'
import { serializer, stringifyMDX } from '@blocks/serializer'

export default () => (
  <Editor
    initialValue='# Hello, world!'
    onChange={({ value }) => {
      console.log(value)
      const mdx = stringifyMDX(serializer.serialize(value))
      console.log(value)
    }}
  />
)