@@ -14,9 +14,9 @@ import 'package:react/src/context.dart';
14
14
import 'package:react/src/ddc_emulated_function_name_bug.dart' as ddc_emulated_function_name_bug;
15
15
import 'package:react/src/js_interop_util.dart' ;
16
16
import 'package:react/src/typedefs.dart' ;
17
- import 'package:react/src/react_client/event_prop_key_to_event_factory.dart' ;
18
17
import 'package:react/src/react_client/factory_util.dart' ;
19
18
19
+ // ignore: deprecated_member_use_from_same_package
20
20
export 'package:react/src/react_client/factory_util.dart' show unconvertJsEventHandler;
21
21
22
22
/// Prepares [children] to be passed to the ReactJS [React.createElement] and
@@ -42,10 +42,6 @@ dynamic listifyChildren(dynamic children) {
42
42
///
43
43
/// If `style` is specified in props, then it too is shallow-converted and included
44
44
/// in the returned Map.
45
- ///
46
- /// Any JS event handlers included in the props for the given [instance] will be
47
- /// unconverted such that the original JS handlers are returned instead of their
48
- /// Dart synthetic counterparts.
49
45
Map unconvertJsProps (/* ReactElement|ReactComponent */ instance) {
50
46
var props = Map .from (JsBackedMap .backedBy (instance.props));
51
47
@@ -58,12 +54,6 @@ Map unconvertJsProps(/* ReactElement|ReactComponent */ instance) {
58
54
throw new ArgumentError ('A Dart Component cannot be passed into unconvertJsProps.' );
59
55
}
60
56
61
- eventPropKeyToEventFactory.keys.forEach ((key) {
62
- if (props.containsKey (key)) {
63
- props[key] = unconvertJsEventHandler (props[key]) ?? props[key];
64
- }
65
- });
66
-
67
57
// Convert the nested style map so it can be read by Dart code.
68
58
var style = props['style' ];
69
59
if (style != null ) {
@@ -82,8 +72,7 @@ mixin JsBackedMapComponentFactoryMixin on ReactComponentFactoryProxy {
82
72
return React .createElement (type, convertedProps, children);
83
73
}
84
74
85
- static JsMap generateExtendedJsProps (Map props) =>
86
- generateJsProps (props, shouldConvertEventHandlers: false , wrapWithJsify: false );
75
+ static JsMap generateExtendedJsProps (Map props) => generateJsProps (props, wrapWithJsify: false );
87
76
}
88
77
89
78
/// Use [ReactDartComponentFactoryProxy2] instead by calling [registerComponent2] .
@@ -199,8 +188,7 @@ class ReactDartComponentFactoryProxy2<TComponent extends Component2> extends Rea
199
188
200
189
/// Returns a JavaScript version of the specified [props] , preprocessed for consumption by ReactJS and prepared for
201
190
/// consumption by the `react` library internals.
202
- static JsMap generateExtendedJsProps (Map props) =>
203
- generateJsProps (props, shouldConvertEventHandlers: false , wrapWithJsify: false );
191
+ static JsMap generateExtendedJsProps (Map props) => generateJsProps (props, wrapWithJsify: false );
204
192
}
205
193
206
194
/// Creates ReactJS [ReactElement] instances for `JSContext` components.
@@ -287,10 +275,8 @@ class ReactJsComponentFactoryProxy extends ReactComponentFactoryProxy {
287
275
@override
288
276
ReactElement build (Map props, [List childrenArgs]) {
289
277
dynamic children = generateChildren (childrenArgs, shouldAlwaysBeList: alwaysReturnChildrenAsList);
290
- JsMap convertedProps = generateJsProps (props,
291
- shouldConvertEventHandlers: shouldConvertDomProps,
292
- convertCallbackRefValue: false ,
293
- additionalRefPropKeys: _additionalRefPropKeys);
278
+ JsMap convertedProps =
279
+ generateJsProps (props, convertCallbackRefValue: false , additionalRefPropKeys: _additionalRefPropKeys);
294
280
return React .createElement (type, convertedProps, children);
295
281
}
296
282
}
@@ -321,7 +307,6 @@ class ReactDomComponentFactoryProxy extends ReactComponentFactoryProxy {
321
307
322
308
/// Performs special handling of certain props for consumption by ReactJS DOM components.
323
309
static void convertProps (Map props) {
324
- convertEventHandlers (props);
325
310
convertRefValue (props);
326
311
}
327
312
}
0 commit comments