Skip to content

Commit

Permalink
Optimize the throw error message to reduce a bit of package size
Browse files Browse the repository at this point in the history
  • Loading branch information
juzser committed Mar 28, 2024
1 parent 52051e4 commit 8226e70
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/components/Combobox/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export function useComboboxTextField() {
const context = inject<ComboboxTextFieldType | undefined>('combobox-textfield', undefined);

if (!context) {
throw new Error(
'No Combobox was provided. Your component must be wrapped in a <Combobox> component.',
);
throw new Error('No Combobox was provided.');
}

return context;
Expand Down
4 changes: 2 additions & 2 deletions src/use/useTheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function useTheme() {

if (!theme) {
throw new Error(
'No theme was provided. Your application must be wrapped in an <AppProvider> component. See https://polaris.shopify.com/components/AppProvider for implementation instructions.',
'No theme was provided.',
);
}

Expand All @@ -18,7 +18,7 @@ export function useThemeName() {

if (!themeName || !themeName.value) {
throw new Error(
'No themeName was provided. Your application must be wrapped in an <AppProvider> or <ThemeProvider> component. See https://polaris.shopify.com/components/app-provider for implementation instructions.'
'No themeName was provided.'
);
}

Expand Down

0 comments on commit 8226e70

Please sign in to comment.