Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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