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.
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:
to:
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.