Skip to content

Commit 34a3852

Browse files
committed
docs: fix @sanity/icons v5 subpath imports in localization, page-builder, seo refs
Same broken root-import pattern fixed in schema.md: @sanity/icons v5 removed named icon exports from the package root, so the old `import { XIcon } from '@sanity/icons'` style type-checks but crashes Sanity Studio at runtime. Update the icon import examples in localization.md, page-builder.md, and seo.md to the v5 per-icon subpath style (e.g. `@sanity/icons/Home`).
1 parent 8b8ab07 commit 34a3852

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

skills/sanity-best-practices/references/localization.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Don't create nearly identical copies with slight differences (e.g., US vs Britis
4343

4444
```typescript
4545
// schemaTypes/locale.ts
46-
import { TranslateIcon } from '@sanity/icons'
46+
import { TranslateIcon } from '@sanity/icons/Translate'
4747
import { defineField, defineType } from 'sanity'
4848

4949
export const localeType = defineType({
@@ -167,7 +167,7 @@ For singletons like homepages that need a separate document per locale, combine
167167

168168
```typescript
169169
// schemaTypes/homePage.ts
170-
import { HomeIcon } from '@sanity/icons'
170+
import { HomeIcon } from '@sanity/icons/Home'
171171
import { defineType, defineField } from 'sanity'
172172

173173
export const homePageType = defineType({
@@ -237,7 +237,7 @@ Create a helper to show one singleton per locale in the Structure:
237237
```typescript
238238
// src/structure/index.ts
239239
import { StructureBuilder, StructureResolver } from 'sanity/structure'
240-
import { HomeIcon } from '@sanity/icons'
240+
import { HomeIcon } from '@sanity/icons/Home'
241241

242242
const LOCALES = ['en', 'fr', 'de']
243243

skills/sanity-best-practices/references/page-builder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Every block should have consistent previews:
7474

7575
```typescript
7676
import { defineType } from "sanity";
77-
import { BlockContentIcon } from "@sanity/icons";
77+
import { BlockContentIcon } from "@sanity/icons/BlockContent";
7878

7979
export const splitImageType = defineType({
8080
name: "splitImage",

skills/sanity-best-practices/references/seo.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Create a redirect document type for content team management.
193193
```typescript
194194
// schemaTypes/redirectType.ts
195195
import { defineField, defineType, SanityDocumentLike } from "sanity";
196-
import { LinkIcon } from "@sanity/icons";
196+
import { LinkIcon } from "@sanity/icons/Link";
197197

198198
function isValidPath(value: string | undefined) {
199199
if (!value) return "Required";

0 commit comments

Comments
 (0)