Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

Global Variable Destructure VS. Import

Mike England edited this page Mar 31, 2020 · 1 revision

It is common to see blocks in Gutenberg that use destructured global variable or as an import. At this time it is recommended to use import when possible since it is consistent with Core Gutenberg practices.

// Destructured Global Variable.
const { RichText } = wp.blockEditor;
// Import.
import { RichText } from '@wordpress/block-editor';
Clone this wiki locally