What is argument of type never is not assignable to parameter of type string in TypeScript

0 votes

This is my code :

export default class ModelCanvas extends Vue {

        taskName: string = 'New Task';

        robot: Task = new Robot(this.uuid(), this.taskName, [])

       

        configKonva: any = {

            width: WIDTH,

            height: HEIGHT,

            draggable: false,

        };

        $refs!: {

            stage: KonvaStage

            layer: KonvaLayer

            elementList: ElementList

        }

        elementTypes: any[] = [

            {

                name: 'Event',

                component: 'EventElement',

                icon: 'mdi-circle-outline',

            },

            {

                name: 'Control',

                component: 'ControlElement',

                icon: 'mdi-rhombus-outline',

                task: null,

            },

            {

                name: 'Keyword',

                component: 'KeywordElement',

                icon: 'mdi-square-outline',

                task: Keyword,

            },

        ];


I got the following TS error:

TS2345: Argument of type 'never[]' is not assignable to parameter of type 'string'.

What exactly should I do?

Apr 18, 2023 in TypeSript by anonymous

edited 4 days ago 112 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP