Skip to content

Instantly share code, notes, and snippets.

View richardvanbergen's full-sized avatar
🐛
Debugging

Richard Vanbergen richardvanbergen

🐛
Debugging
View GitHub Profile
@kmelve
kmelve / BlockEditor.js
Created September 14, 2019 11:56
Custom portable text / block editor for Sanity with markdown paste and stats
import React, { Component, Fragment } from 'react'
import { BlockEditor } from 'part:@sanity/form-builder'
import Switch from 'part:@sanity/components/toggles/switch'
import css from './BlockEditor.module.css'
import { handlePaste } from './handlePaste'
export default class CustomEditor extends Component {
state = {
customPaste: false
}