Skip to content

Commit

Permalink
Revert breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronlademann-wf committed Aug 19, 2024
1 parent d9129a3 commit c5119ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/src/component/prop_mixins.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<ReactNode>? get children {
List<dynamic>? get children {
final value = _raw$ReactProps$children;

// Most common case; Dart components should all have List children
Expand All @@ -68,7 +68,7 @@ abstract class _$ReactPropsMixin {
return [value];
}

set children(List<ReactNode>? value) => _raw$ReactProps$children = value;
set children(List<dynamic>? value) => _raw$ReactProps$children = value;

/// A String that differentiates a component from its siblings.
///
Expand Down
10 changes: 5 additions & 5 deletions lib/src/component/prop_mixins.over_react.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ main() {
});

test('null: returns an empty list', () {
expect(getTypedView({childrenKey: null}).children, same(const <ReactNode>[]));
expect(getTypedView({childrenKey: null}).children, same(const []));
});

test('a single child: wraps in a list', () {
Expand Down

0 comments on commit c5119ff

Please sign in to comment.