ItsJonQ / g2

✨ An experimental reimagining of WordPress components
http://g2-components.com/
MIT License
105 stars 12 forks source link

Migration to Gutenberg: Remove references to react #138

Open ItsJonQ opened 4 years ago

ItsJonQ commented 4 years ago

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 commented 3 years ago

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