Skip to content

Expression of type 'string' can't be used to index type #8562

@Gazz1e

Description

@Gazz1e

Within the section "Show items available in the selected list in the item dropdown", the loadItems() function has the line...

resolve(items[wp.properties.listName]);

Which produces the error...

Expression of type 'string' can't be used to index type

This can be resolve by changing the line to...

resolve(items[wp.properties.listName as keyof typeof items]);


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docsCategory: SharePoint developer/development documentation relatedarea:docs-commentCategory: Comment left on bottom of a docs page here: https://docs.microsoft.com/sharepoint/devtype:archive-old-issueIssues which are closed as tool old for active work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions