-
Notifications
You must be signed in to change notification settings - Fork 68
CPLAT-3968 CPLAT-3969 Add unconvertJsProps() util to react_client.dart #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CPLAT-3968 CPLAT-3969 Add unconvertJsProps() util to react_client.dart #153
Conversation
607e1fc
to
dbe7d70
Compare
+1 |
@greglittlefield-wf I went ahead and added a |
+1 |
test/react_client_test.dart
Outdated
for (final key in eventPropKeyToEventFactory.keys) { | ||
expect(jsProps[key], isNotNull, | ||
reason: 'JS event handler prop should not be null'); | ||
expect(identical(jsProps[key], originalHandlers[key]), isTrue, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI there's a same
matcher you can use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't believe I didn't know that
+1 |
Consumer tests:
|
+1, merging |
Description
The
getJsProps()
method in over_react makes more sense in this library, as it is intended to be used only with JS components and not Dart components. over_react has its owngetProps()
that should be sufficient (and usesgetJsProps()
internally).To avoid naming conflicts and ambiguous imports in over_react, I've added the same functionality under a different name:
unconvertJsProps()
. This should also help clarify its intended usage in the future when some additional JS map work is taken on.Additionally, logic was added to handle the unconverting of the JS event handlers (they are converted to their synthetic counterparts when added), which is necessary for Dart 2 compatibility.
Testing
Code Review
@greglittlefield-wf @aaronlademann-wf @kealjones-wk @corwinsheahan-wf