You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given a widget where children are defined as matching an interface or being undefined and another widget that uses that widget, i am unable to set the children of the widget using the test harness as it throws an error relating to the children being optional:
// WidgetsinterfaceChildren{foo?: RenderResult;bar?: (baz: string)=>RenderResult;}constfactory=create().children<Children|undefined>();exportconstWidget=factory(function({
children
}){const[{ foo, bar }={foo: undefined,bar: undefined}]=children();return<virtual>{foo}{bar('test')}</virtual>;});exportconstParentWidget=factory(function(){return<Widgetkey='test'>{foo: 'test'}</Widget>})
I see the following error message (taken from actual usage involving the RadioGroup):
"Argument of type 'Wrapped<OptionalWNodeFactory<{ properties: Comparable<RadioGroupProperties & WidgetProperties & ThemeProperties>; children: RadioGroupChildren; }>>' is not assignable to parameter of type 'Wrapped<WNodeFactory<{ properties: any; children: any; }>>'.\n Type 'Wrapped<OptionalWNodeFactory<{ properties: Comparable<RadioGroupProperties & WidgetProperties & ThemeProperties>; children: RadioGroupChildren; }>>' is not assignable to type 'WNodeFactory<{ properties: any; children: any; }>'.\n Types of property 'type' are incompatible.\n Type '\"optional\"' is not assignable to type '\"required\"'.",
"source": "ts",
"startLineNumber": 83,
"startColumn": 11,
"endLineNumber": 83,
"endColumn": 28
}
Expected behavior:
I should be able to trigger these functions and test the output due to a type error.
Actual behavior:
I have to cast the WrappedWidget to any to get past the existing typings.
The text was updated successfully, but these errors were encountered:
Bug
Package Version:
Code
Given a widget where children are defined as matching an interface or being undefined and another widget that uses that widget, i am unable to set the children of the widget using the test harness as it throws an error relating to the children being optional:
I see the following error message (taken from actual usage involving the
RadioGroup
):Expected behavior:
I should be able to trigger these functions and test the output due to a type error.
Actual behavior:
I have to cast the
WrappedWidget
toany
to get past the existing typings.The text was updated successfully, but these errors were encountered: