Skip to content

Dashboard: fix typecheck error in AddCustomAppModal#236

Open
ahmedhesham6 wants to merge 1 commit into
oblien:mainfrom
ahmedhesham6:fix/dashboard-addcustomapp-typecheck
Open

Dashboard: fix typecheck error in AddCustomAppModal#236
ahmedhesham6 wants to merge 1 commit into
oblien:mainfrom
ahmedhesham6:fix/dashboard-addcustomapp-typecheck

Conversation

@ahmedhesham6

Copy link
Copy Markdown
Contributor

CI's Typecheck job fails on main (and therefore on every PR, including #222):

src/components/apps/AddCustomAppModal.tsx(112,9): error TS2322: Type 'unknown' is not assignable to type 'ReactNode'.

template is useState<unknown>, so {template && …} can evaluate to the unknown value itself when it's falsy, and JSX rejects unknown as a child. Comparing against null narrows the guard to a boolean.

Introduced on main in e8bc360; the #235 merge run shows the same failure, so this is not specific to any open PR.

One-line change, no behavior difference (template is only ever null or a parsed object).

`template` is `useState<unknown>`, so `{template && …}` types the
short-circuit value as unknown, which is not assignable to ReactNode.
Compare against null instead so the expression narrows to boolean.
Broke on main in e8bc360 and fails every CI run since (e.g. the oblien#235
merge run).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant