Skip to content

Commit

Permalink
fix: stricter types (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
dannyhw committed Mar 8, 2024
1 parent 4864c24 commit 1268743
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/expo-example/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import App from './App';
describe('<App />', () => {
it('has 1 child', () => {
const tree = renderer.create(<App />).toJSON();
if (!Array.isArray(tree) && tree.children) {
if (!Array.isArray(tree) && tree?.children) {
expect(tree.children.length).toBe(1);
} else {
throw new Error('App has no children');
Expand Down
6 changes: 4 additions & 2 deletions examples/expo-example/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
"compilerOptions": {
"skipLibCheck": true,
"lib": ["es6"],
"baseUrl": "./"
"baseUrl": "./",
"strict": true
},
"extends": "expo/tsconfig.base"
"extends": "expo/tsconfig.base",
"include": ["./.storybook/", "./.storybook-web/", "./*"]
}
6 changes: 3 additions & 3 deletions packages/react-native/src/Start.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import { PreviewWithSelection } from '@storybook/preview-api/dist/preview-web';
import { createBrowserChannel } from '@storybook/channels';
import { View } from './View';
import type { ReactRenderer } from '@storybook/react';
import type { NormalizedStoriesSpecifier } from '@storybook/types';
import type { NormalizedStoriesSpecifier, StoryIndex } from '@storybook/types';

export function prepareStories({
storyEntries,
}: {
storyEntries: Array<NormalizedStoriesSpecifier & { req: any }>;
}) {
let index = {
let index: StoryIndex = {
v: 4,
entries: {},
};

let importMap = {};
let importMap: Record<string, any> = {};

const makeTitle = (
fileName: string,
Expand Down

0 comments on commit 1268743

Please sign in to comment.