Skip to content

Commit c33e4f3

Browse files
committed
chore: make TypeScript stricter
1 parent 2470d6f commit c33e4f3

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export interface HidingHeaderProps {
3232
}
3333

3434
export const HidingHeader: Component<HidingHeaderProps> = rawProps => {
35-
let container: HTMLElement;
35+
let container: HTMLElement | undefined;
3636

3737
const props = mergeProps(
3838
{
@@ -49,6 +49,7 @@ export const HidingHeader: Component<HidingHeaderProps> = rawProps => {
4949
>({} as ReturnType<typeof hidingHeader>);
5050

5151
createEffect(() => {
52+
if (!container) return;
5253
const instance = hidingHeader(container, {
5354
heightPropertyName: props.heightPropertyName,
5455
boundsHeightPropertyName: props.boundsHeightPropertyName,

tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
"target": "ESNext",
2828
"module": "ESNext",
2929
"moduleResolution": "node",
30+
"strict": true,
31+
"alwaysStrict": true,
32+
"strictNullChecks": true,
3033
"allowSyntheticDefaultImports": true,
3134
"esModuleInterop": true,
3235
"jsx": "preserve",

0 commit comments

Comments
 (0)