Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to Gutenberg: Remove references to react #138

Open
ItsJonQ opened this issue Nov 18, 2020 · 1 comment
Open

Migration to Gutenberg: Remove references to react #138

ItsJonQ opened this issue Nov 18, 2020 · 1 comment

Comments

@ItsJonQ
Copy link
Owner

ItsJonQ commented Nov 18, 2020

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
Copy link
Owner Author

ItsJonQ commented Nov 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant