Open Tatsinnit opened 4 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.
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 thechildren
prop in JSX expects a type assignable toReactNode
, and in the code, thechildren
prop containsunknown[]
, which is incompatible.This issue typically arises from returning
<>{value}</>
wherevalue
has the typeunknown
. To resolve the error, you need to ensure that thevalue
is safely cast or transformed into a type compatible withReactNode
before being rendered.Additional Details:
In cases where
value
isunknown
, explicitly cast or transform it into a string usingString(value)
. This makes the type compatible withReactNode
.For
ValueType.Bytes
and the default case,value
is wrapped inString(value)
to ensure it's rendered as a string.For
ValueType.AddressArray
, ensure that thevalue
is correctly parsed into a string array and joined with a separator. EnsureJSON.parse
operates on valid JSON to avoid runtime errors.This approach ensures type safety and fixes the
TS2322
error while maintaining the intended functionality.fyi: please: ❤️ @hsubramanianaks , @ReinierCC , @tejhan , @qpetraroia