Skip to content

Commit 69ae214

Browse files
committed
fix: simplify registration examples
1 parent 96438a7 commit 69ae214

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

.vitepress/theme/components/CanvasPlayground.vue

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3533,19 +3533,7 @@ function frameworkElementRegistration(framework){
35333533
35343534
function buildRegistrationSource(framework){
35353535
const reg = frameworkElementRegistration(framework);
3536-
return `// The <Canvas> element must be registered before a template can use it.
3537-
// (@nativescript/canvas ships a CanvasModule for Angular, but it registers via a
3538-
// CommonJS require() that resolves to undefined in ESM/.mjs bundles, so register here.)
3539-
const canvasProto = (Canvas as any).prototype;
3540-
if (!Object.getOwnPropertyDescriptor(canvasProto, "nodeName")?.set) {
3541-
// The Canvas view exposes nodeName as a getter only; framework renderers assign it.
3542-
Object.defineProperty(canvasProto, "nodeName", {
3543-
get() { return this._nodeName ?? "CANVAS"; },
3544-
set(value: string) { this._nodeName = value; },
3545-
configurable: true,
3546-
enumerable: true,
3547-
});
3548-
}
3536+
return `// Register the <Canvas> element before templates/renderers use it.
35493537
try {
35503538
${reg.call}("Canvas", () => Canvas);
35513539
} catch (err) {

0 commit comments

Comments
 (0)