@@ -22,7 +22,7 @@ export 'package:react/src/react_client/factory_util.dart' show generateJsProps;
2222/// Currently only involves converting a top-level non-[List] [Iterable] to
2323/// a non-growable [List] , but this may be updated in the future to support
2424/// advanced nesting and other kinds of children.
25- dynamic listifyChildren (dynamic children) {
25+ ReactNode listifyChildren (ReactNode children) {
2626 if (React .isValidElement (children)) {
2727 // Short-circuit if we're dealing with a ReactElement to avoid the dart2js
2828 // interceptor lookup involved in Dart type-checking.
@@ -63,7 +63,7 @@ Map unconvertJsProps(/* ReactElement|ReactComponent */ instance) {
6363/// Shared component factory proxy [build] method for components that utilize [JsBackedMap] s.
6464mixin JsBackedMapComponentFactoryMixin on ReactComponentFactoryProxy {
6565 @override
66- ReactElement build (Map props, [List childrenArgs = const []]) {
66+ ReactElement build (Map props, [List < ReactNode > childrenArgs = const []]) {
6767 final children = generateChildren (childrenArgs, shouldAlwaysBeList: true );
6868 final convertedProps = generateExtendedJsProps (props);
6969 return React .createElement (type, convertedProps, children);
@@ -89,7 +89,7 @@ class ReactDartComponentFactoryProxy<TComponent extends Component> extends React
8989 ReactClass get type => reactClass;
9090
9191 @override
92- ReactElement build (Map props, [List childrenArgs = const []]) {
92+ ReactElement build (Map props, [List < ReactNode > childrenArgs = const []]) {
9393 var children = convertArgsToChildren (childrenArgs);
9494 children = listifyChildren (children);
9595
@@ -98,7 +98,7 @@ class ReactDartComponentFactoryProxy<TComponent extends Component> extends React
9898
9999 /// Returns a JavaScript version of the specified [props] , preprocessed for consumption by ReactJS and prepared for
100100 /// consumption by the `react` library internals.
101- static InteropProps generateExtendedJsProps (Map props, dynamic children, {Map ? defaultProps}) {
101+ static InteropProps generateExtendedJsProps (Map props, ReactNode children, {Map ? defaultProps}) {
102102 if (children == null ) {
103103 children = [];
104104 } else if (children is ! Iterable ) {
@@ -212,8 +212,8 @@ class ReactJsContextComponentFactoryProxy extends ReactJsComponentFactoryProxy {
212212 super (jsClass, shouldConvertDomProps: shouldConvertDomProps);
213213
214214 @override
215- ReactElement build (Map props, [List childrenArgs = const []]) {
216- dynamic children = generateChildren (childrenArgs);
215+ ReactElement build (Map props, [List < ReactNode > childrenArgs = const []]) {
216+ var children = generateChildren (childrenArgs);
217217
218218 if (isConsumer) {
219219 if (children is Function ) {
@@ -271,7 +271,7 @@ class ReactJsComponentFactoryProxy extends ReactComponentFactoryProxy {
271271 }
272272
273273 @override
274- ReactElement build (Map props, [List childrenArgs = const []]) {
274+ ReactElement build (Map props, [List < ReactNode > childrenArgs = const []]) {
275275 final children = generateChildren (childrenArgs, shouldAlwaysBeList: alwaysReturnChildrenAsList);
276276 final convertedProps =
277277 generateJsProps (props, convertCallbackRefValue: false , additionalRefPropKeys: _additionalRefPropKeys);
@@ -292,7 +292,7 @@ class ReactDomComponentFactoryProxy extends ReactComponentFactoryProxy {
292292 String get type => name;
293293
294294 @override
295- ReactElement build (Map props, [List childrenArgs = const []]) {
295+ ReactElement build (Map props, [List < ReactNode > childrenArgs = const []]) {
296296 final children = generateChildren (childrenArgs);
297297 final convertedProps = generateJsProps (props, convertCallbackRefValue: false , wrapWithJsify: true );
298298 return React .createElement (type, convertedProps, children);
0 commit comments