-
Notifications
You must be signed in to change notification settings - Fork 68
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
Support component classes declared in JS #112
Support component classes declared in JS #112
Conversation
# Conflicts: # test/js_interop_helpers_test/shared_tests.dart
/// | ||
/// This is optional, as you won't always need to access the component's API. | ||
@JS() | ||
class FooComponent { |
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.
Just for my own understanding, this is only necessary if you want a typed interface into your JS component correct? You could still call API methods on the component you just wouldn't get autocompletion or static analysis, right?
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.
Good question; I'll clarify this in the comment.
For package:js
, you actually have to declare the interop class to be able to call those methods on it. The typing, however, doesn't matter, so long as it is a @JS
.
This will be added in some form as part of the upcoming react-dart 5.0.0 release |
Not a clean diff: Depends on PRs #110 and #111
Problem
#109 There wasn't a path to use React components declared in JS within react-dart.
Solution
ReactJsComponentFactoryProxy
to enable wrapping of JS componentsexample
directoryjsify
, add newjsifyAndAllowInterop
jsify
frompackage:js
, and doesn't name-collideTesting