where this a tsx file. Typescript doesn’t like the Webix tag and fails with “cannot find name Webix…”
I know this is a basic question but what am i missing? I have been though the typescript and react samples provided but there are none with both technologies together.
Well I spent the day trying to understand what is going on, the link although useful is related to angular and I have no further clarity on my issue.
I have isolated the problem though. When I get the sample Typescript code code from GitHub - webix-hub/typescript-demo: Using Webix UI with typescript the code compiles and works fine using NPM. Inside Visual Studio, I can also run the sample fine too! But VS gives me 30 compilation errors with:
results in a TypeScript error “Cannot find name ‘Webix’” which makes sense because I only imported the script. And if I change to:
import Webix from “webixMain”;
results in a TypeScript error “Cannot find module ‘webixMain’” which makes sense because it’s not. If it could find the module I am sure it would say “is not a module” like previous post because clearly the webix types are not defined as a module.
How to get the TypeScript aspect working?
As you can I am travelling in circles atm and lacking the understanding! Hope you can shed some insight!
Changing to lowercase webix → results in 'property webix does not exist on type ‘JSX.IntrinsicElements’.
The issue I described above is about the tag that is not recognised by TypeScript. It is not imported as a module anywhere and therefore not recognisable.
I think you missed to define the container for slider.
depending on your sample it should be something like
var mike = webix.ui({
container: this.element, //or any other element or id
view: "slider",
label: "Level",
value: "20",
min: 10,
max: 120,
name: "s44"
});