-
Notifications
You must be signed in to change notification settings - Fork 170
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 $ as an alias for WidgetCollection #1679
Comments
Caveat: This ONLY works if we put $ in global scope, since the character can not be used for intrinsic JSX elements. While I'm for that (as outlined above), we should probably discuss the PROs and CONs of that beforehand. The only library that I found using this is jQuery. While that is fairly popular, it is not very useful in tabris, and it has a no-conflict mode. |
I agree that the current |
As it turns out the auto-import of "$" does not always work in Visual Studio Code, so making it global is the quickest fix for this. As described on issue #1679 this should not really conflict with any known libraries. Change-Id: I177539e5ae2c334e78424394442b5f0b8bc644d6
Problem description
We often need to write JSX like this...
Expected behavior
A shorter alias such as
$
would save a lot of characters in the long run.Bonus: Since WidgetCollection API is already somewhat reminiscent of jQuery, we could put
$
in to global scope and provide some more jQuery-like API on it. I'm thinking specifically on something like$(selector)
, where the selector searches globally through any currently existing widgets.Environment
any
Code snippet
The result would be:
Note:
JSX supports empty element names like this...
... but unfortunately not with custom renderer like we use.
The text was updated successfully, but these errors were encountered: