How do I import polaris-icons?

Highlighted
Tourist
4 0 2

Hi there,

I'm trying to import polaris icons using this code

import { Navigation } from '@shopify/polaris'
import { HomeMajor, OrdersMajor, ProductsMajor } from '@shopify/polaris-icons'


export default function MyNavigation() {

    return (
        <Navigation location="/">
            <Navigation.Section
                items={[
                    {
                        url: '/path/to/place',
                        label: 'Home',
                        icon: HomeMajor,
                    },
                    {
                        url: '/path/to/place',
                        label: 'Orders',
                        icon: OrdersMajor,
                        badge: '15',
                    },
                    {
                        url: '/path/to/place',
                        label: 'Products',
                        icon: ProductsMajor,
                    },
                ]}
            />
        </Navigation>
    )
}
 
However I get the following error :  Attempted import error: 'HomeMajor' is not exported from '@shopify/polaris-icons'.
 
Am I importing it incorrectly?
Note: I have run npm install '@shopify/polaris-icons'
Highlighted
New Member
1 0 0

Restart your application. That worked for me at least

0 Likes