nativescript-community / nativescript-community/ui-canvas

Error: 'typeof CanvasView' is not assignable to type 'ViewClass'

Open
#12 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
38
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Make sure to check the demo app(s) for sample usage
Make sure to check the existing issues in this repository
If the demo apps cannot help and there is no issue for your problem, tell us about it

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

Which platform(s) does your issue occur on?
  • Both (though not tested on iOS, but it doesn't run, so it's for both)
Please, provide the following version numbers that your issue occurs with:
  • CLI: 5.4.2
  • Cross-platform modules: 5.4.3
  • Runtime(s): tns-android version 5.4.0, nativescript-angular 8.0.0
  • Plugin(s): 2.1.24
Please, tell us how to recreate the issue in as much detail as possible.

Describe the steps to reproduce it.

The instructions on the README.md file doesn't work.

Is there any code involved?
  • provide a code example to recreate the problem

this is my app.module

import { registerElement } from "nativescript-angular/element-registry";
import { CanvasView } from 'nativescript-canvas';

registerElement('CanvasView', () => CanvasView);

And I'm getting this error:

Type 'typeof CanvasView' is not assignable to type 'ViewClass'.
  Type 'CanvasView' is not assignable to type 'View'.
    Property 'android' is missing in type 'CanvasView'.
element-registry.d.ts(46, 36): The expected type comes from the return type of this signature.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the README.md instructions and the app.module example using registerElement and CanvasView. Reproduce the TypeScript error with the listed NativeScript versions, then verify the documented sample usage works on the reported platforms without the ViewClass type error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.