Azure / vscode-aks-tools

Visual Studio Code extension for Azure Kubernetes Service
MIT License
42 stars 52 forks source link

Fix the dependabot related issue. #1094

Open Tatsinnit opened 4 days ago

Tatsinnit commented 4 days ago

Hiya, This PR fixes #1088

Sample VISX:

vscode-aks-tools-1.5.2-dependabot-fix.vsix.zip

Details

I think the error TS2322: Type '{ children: unknown[]; }' is not assignable to type '{ children?: ReactNode; }' occurs because the children prop in JSX expects a type assignable to ReactNode, and in the code, the children prop contains unknown[], which is incompatible.

This issue typically arises from returning <>{value}</> where value has the type unknown. To resolve the error, you need to ensure that the value is safely cast or transformed into a type compatible with ReactNode before being rendered.

Additional Details:

This approach ensures type safety and fixes the TS2322 error while maintaining the intended functionality.

fyi: please: ❤️ @hsubramanianaks , @ReinierCC , @tejhan , @qpetraroia

Tatsinnit commented 3 days ago

Looks good to me, Hope testing worked for you. Thank you @Tatsinnit

⛩️ Indeed, I was wondering if anyone of you can double test to make sure, it is not the works in Mac case :) but I think it should be safe, will ask around and get folks to do a quick shake. cc: @ReinierCC + @tejhan ❤️ if one of you have small window of time to test this please. Thank you so much in advance.