This repository was archived by the owner on Mar 18, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/dom/nativescript-vue-next/runtime Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,20 @@ export class NSVElement<T extends NativeView = NativeView> extends NSVNode imple
460460 private static readonly recycledOldProps : Record < string , any > = Object . freeze ( { } ) ;
461461
462462 setAttribute ( name : string , value : unknown ) {
463+ /*
464+ * A note to myself after following this rabbit hole several times before:
465+ * Users may intuitively try to set the "text" property on an element such as <text>, simply because
466+ * it's a likely property name to expect, and because it appears to be corroborated by Intellisense,
467+ * due to our default of typing any unrecognised JSX key as a string value.
468+ *
469+ * In fact, RNText doesn't implement a text property in its setProps() method, so it (correctly) no-ops.
470+ * To set text, we expect users to write it as:
471+ *
472+ * <text>hello</text>
473+ *
474+ * ... This creates an NSVText node with the text "hello", which Svelte reads using the .data accessor.
475+ */
476+
463477 [ "style" ,
464478 "styleSheet" , // TODO: implement
465479 "class" ,
You can’t perform that action at this time.
0 commit comments