WordPress Block Development – trouble importing from @wordpress/icons
I am running into some trouble in importing the wordpress icons package. Trying to do what is described on this page.
https://developer.wordpress.org/block-editor/components/placeholder/
Just like every other package, I have imported the package via npm, then placed the import statement at the top of my file.
import { pin, list, grid } from 'wordpress user/icons';
and then using it like this.
<Placeholder icon={ pin } label={ __( 'My Projects' ) }>
When I view the block in the editor, my block is now broken and I get an error in the console:
TypeError: Cannot read property ‘pin’ of undefined
Is there an extra step I need to take to get the icon package to work?
Leave an answer