Skip to content

Commit 0bc56b4

Browse files
timphandevclaude
andcommitted
docs(native-recipe): say where each setting reports a variant that one theme lacks
The page said that the config compiles and only a call that sets the missing variant fails, which holds with exactOptionalPropertyTypes only. With strict alone, as React Native apps compile, TypeScript reports the error at the config. The page now names both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent f315db0 commit 0bc56b4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎docs/src/content/docs/native-recipe/create-themed-recipes.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ createStyleRecipe((theme) => ({
8585
}));
8686

8787
// Wrong: the branch is around the variant, so one theme has no `outlined`.
88+
// TypeScript reports an error here. With exactOptionalPropertyTypes, it
89+
// reports one at each call that sets `outlined` instead.
8890
const box = createStyleRecipe((theme) => ({
8991
variants: theme.highContrast
9092
? {}
9193
: { outlined: { true: { borderWidth: 1 } } },
9294
}));
9395

94-
// @ts-expect-error: the config compiles, but no call can set `outlined`.
9596
box(light, { outlined: true });
9697
```
9798

0 commit comments

Comments
 (0)