-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Handle "native" props better for different renderers #9
Comments
Just random thoughts: I think there should be a well-documented set of rules for renaming keys and it should give us two-way mapping. btw. The mapping doesn't need to be shallow, handling As an escape hatch there should be a way hot to quote individual keys when coverting into js-land[1]. And the custom bean should give us some escape hatch to get properties using js-land key names. [1] #8 |
@Lokeh FYI, I started experimental work on that props translation. See the above commit. |
I just completed the experimental work and ported[1] my code to use this branch[2]. Good news is that implementation of the props-bean wasn't that hard[3], but I had to use val-hook-2 branch of cljs-bean[4]. I think we can make that work go into next cljs-bean release. [1] binaryage/cljs-react-three-fiber@c79db08 |
In helix The strategy here is to be explicit about what prop transformation you want to use when rendering the component as an element; e.g. there could exist an This way, the |
We could remove a lot of the work involved with using different renderers (react-three-fiber, react-native, etc.) and make interop slightly easier if we defaulted to always converting kebab-case to camelCase when using
$
/$$
, and always transforming camelCase to kebab-case indefnc
body via a bean with customkey->prop
andprop->key
as suggested by @darwin.There might still need to be some determination of whether an element is "native" in order to decide whether to recursively convert the
:style
key, but this could be handled byhelix.dom
and / or other wrapper macros on a per-case basis.The text was updated successfully, but these errors were encountered: