From e65c0490d90827f6a0057bc03ab3d808e7490fdd Mon Sep 17 00:00:00 2001 From: Aaron Lademann Date: Mon, 4 Mar 2024 12:13:15 -0700 Subject: [PATCH] Revert breaking changes --- lib/src/component/ref_util.dart | 4 ++-- lib/src/component_declaration/function_component.dart | 2 +- .../new_boilerplate/function_component_test.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/component/ref_util.dart b/lib/src/component/ref_util.dart index 5c4a1f6328..d5159ed694 100644 --- a/lib/src/component/ref_util.dart +++ b/lib/src/component/ref_util.dart @@ -212,7 +212,7 @@ Ref createRef() => react_interop.createRef(); /// _$Foo2Config, // ignore: undefined_identifier /// ); UiFactory uiForwardRef( - ReactNode Function(TProps props, dynamic ref) functionComponent, dynamic _config) { + /*ReactNode*/ dynamic Function(TProps props, dynamic ref) functionComponent, dynamic _config) { ArgumentError.checkNotNull(_config, '_config'); if (_config is! UiFactoryConfig) { @@ -231,7 +231,7 @@ UiFactory uiForwardRef( // this will be an empty string. final displayName = config.displayName ?? getFunctionName(functionComponent); - ReactNode _uiFunctionWrapper(JsBackedMap props, dynamic ref) { + /*ReactNode*/ dynamic _uiFunctionWrapper(JsBackedMap props, dynamic ref) { return functionComponent(propsFactory!.jsMap(props), ref); } diff --git a/lib/src/component_declaration/function_component.dart b/lib/src/component_declaration/function_component.dart index 1ee0ccb448..ba3d6b16d4 100644 --- a/lib/src/component_declaration/function_component.dart +++ b/lib/src/component_declaration/function_component.dart @@ -96,7 +96,7 @@ export 'component_type_checking.dart' /// Learn more: . // TODO: right now only top level factory declarations will generate props configs. UiFactory uiFunction( - ReactNode Function(TProps props) functionComponent, + /*ReactNode*/ dynamic Function(TProps props) functionComponent, dynamic _config, ) { ArgumentError.checkNotNull(_config, '_config'); diff --git a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/new_boilerplate/function_component_test.dart b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/new_boilerplate/function_component_test.dart index dea52eda9a..fb6f4594b3 100644 --- a/test/over_react/component_declaration/non_null_safe_builder_integration_tests/new_boilerplate/function_component_test.dart +++ b/test/over_react/component_declaration/non_null_safe_builder_integration_tests/new_boilerplate/function_component_test.dart @@ -143,7 +143,7 @@ main() { GenericUiProps props; setUp(() { - final genericFactory = uiFunction((_) { return null; }, UiFactoryConfig()); + final genericFactory = uiFunction((_) {}, UiFactoryConfig()); final factoryProps = genericFactory(); expect(factoryProps, isA(), reason: 'test setup check'); props = factoryProps as GenericUiProps;