diff --git a/lib/src/component/prop_mixins.dart b/lib/src/component/prop_mixins.dart index 80522ee0a..a2ff6f191 100644 --- a/lib/src/component/prop_mixins.dart +++ b/lib/src/component/prop_mixins.dart @@ -17,7 +17,7 @@ /// Various prop related mixins to be used with `UiComponent` descendants. library over_react.prop_mixins; -import 'package:over_react/over_react.dart' show AriaPropsMapView, AriaPropsMixin, DomProps, PropsMeta, ReactNode; +import 'package:over_react/over_react.dart' show AriaPropsMapView, AriaPropsMixin, DomProps, PropsMeta; // Must import these consts because they are used in the transformed code. // ignore: deprecated_member_use, unused_shown_name import 'package:over_react/over_react.dart' show PropDescriptor, ConsumedProps, PropsMeta; @@ -46,10 +46,10 @@ abstract class _$ReactPropsMixin { // This private field is namespaced to avoid colliding with other classes. @Accessor(key: 'children') - ReactNode _raw$ReactProps$children; + dynamic _raw$ReactProps$children; /// The children that were passed in to this component when it was built. - List? get children { + List? get children { final value = _raw$ReactProps$children; // Most common case; Dart components should all have List children @@ -68,7 +68,7 @@ abstract class _$ReactPropsMixin { return [value]; } - set children(List? value) => _raw$ReactProps$children = value; + set children(List? value) => _raw$ReactProps$children = value; /// A String that differentiates a component from its siblings. /// diff --git a/lib/src/component/prop_mixins.over_react.g.dart b/lib/src/component/prop_mixins.over_react.g.dart index cce80be3e..11b10b033 100644 --- a/lib/src/component/prop_mixins.over_react.g.dart +++ b/lib/src/component/prop_mixins.over_react.g.dart @@ -13,7 +13,7 @@ abstract class ReactPropsMixin implements _$ReactPropsMixin { static const PropsMeta meta = _$metaForReactPropsMixin; @override - List? get children { + List? get children { final value = _raw$ReactProps$children; if (value is List) return value; if (value == null) { @@ -23,7 +23,7 @@ abstract class ReactPropsMixin implements _$ReactPropsMixin { } @override - set children(List? value) => _raw$ReactProps$children = value; + set children(List? value) => _raw$ReactProps$children = value; @override String? get key => props['key'] as String?; @override @@ -33,14 +33,14 @@ abstract class ReactPropsMixin implements _$ReactPropsMixin { /// @override @Accessor(key: 'children') - ReactNode get _raw$ReactProps$children => + dynamic get _raw$ReactProps$children => (props[_$key___raw$ReactProps$children___$ReactPropsMixin] ?? null) - as ReactNode; + as dynamic; /// @override @Accessor(key: 'children') - set _raw$ReactProps$children(ReactNode value) => + set _raw$ReactProps$children(dynamic value) => props[_$key___raw$ReactProps$children___$ReactPropsMixin] = value; /// Either a String used to retrieve the element at a later time via [react.Component.ref], diff --git a/test/over_react/component_declaration/component_base_test.dart b/test/over_react/component_declaration/component_base_test.dart index ee3bcaaf8..f02b4eef1 100644 --- a/test/over_react/component_declaration/component_base_test.dart +++ b/test/over_react/component_declaration/component_base_test.dart @@ -498,7 +498,7 @@ main() { }); test('null: returns an empty list', () { - expect(getTypedView({childrenKey: null}).children, same(const [])); + expect(getTypedView({childrenKey: null}).children, same(const [])); }); test('a single child: wraps in a list', () {