g2 icon indicating copy to clipboard operation
g2 copied to clipboard

Migration to Gutenberg: Remove references to react

Open ItsJonQ opened this issue 4 years ago • 1 comments

Due to how the JS code is compiled, Gutenberg React code does not start with the standard import React from 'react';.

Hooks and utils that come from the react package would instead come from @wordpress/element.

For example, we'll need to refactor code from this:

import React, { useRef }  from 'react'

to:

import { useRef } from '@wordpress/element';

This is something we'll either do as a final step within this @itsjonq/g2 repo before migration. Or, this is something we'll refactor when the code lands within Gutenberg.

ItsJonQ avatar Nov 18 '20 01:11 ItsJonQ

We'll do this when we copy/paste the files into Gutenberg. Moving this to Phase 2.

ItsJonQ avatar Nov 23 '20 16:11 ItsJonQ