-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Dashicons use wp.element.Component instead of importing it #3952
Comments
Hi @jaschaio, Thanks for the report. How'd you end up on this? Did you try |
@jasmussen should know the details. I think that Dashicons are automatically generated outside of Gutenberg and that's why they reference |
Not sure if this answers your questions, but Dashicons are built from this repo: https://github.com/WordPress/dashicons — you clone that, npm install and npm run build. That then converts a folder of SVGs into a React component. We can adjust what that React component contains, though, so if changes need to happen in how that component is built, we can fix it upstream. |
It might be tricky to fix it at the moment because we don't publish |
@gziolo Do you know if this was addressed, or needs further action? |
We should publish the first alpha version of |
Depends on #6708. |
We can use Related code line to update: https://github.com/WordPress/gutenberg/blob/master/components/dashicon/index.js#L16. @jasmussen does it require any external changes, too? |
Sorry I missed the ping. I'm not sure what change needs to be made, but if a change to the dashicons component needs to happen I can do that change quickly. Just let me know what to change that line to. |
|
@gziolo Apologies for being slow. I think it's the following file that needs to be updated: https://github.com/WordPress/dashicons/blob/master/sources/react/index-header.jsx#L16 — this is a source file that is being used to build the React component with a grunt script. I can add the import, but I still need an export, no? |
I think that import is fine. I think @aduth should know better what is the best way to tackle it. I have no background knowledge of when and how this repository is used. You might need to set |
Right now the process for creating a new dashicon is:
It doesn't have to be this way — I'm just confused as to how to proceed. |
I'm confused, too. Maybe @mtias can help, too? |
I noticed the Following inconsistency which gives me errors if I try to reutilize certain components in a different context than the WordPress Admin. All other components within the
components
directoryimport { Component } from '@wordpress/element';
. But the Dashicons directly extendswp.element.Component
instead of importing and using the{ Component }
class from@wordpress/element
.That makes almost any component that imports the Dashicons depending on that the
wp.element
object is defined. Maybe I am overlooking something here but I felt that its an inconsistency and couldn't immediately understand why.Please let me know as well if this issue should be raised in the Dashicon repro instead as apparently that's where the file is coming from.
The text was updated successfully, but these errors were encountered: