Skip to content
This repository was archived by the owner on Jul 30, 2018. It is now read-only.
This repository was archived by the owner on Jul 30, 2018. It is now read-only.

dojo/widget-core typo in code snippet #957

@agubler

Description

@agubler

@sombrerox commented on Thu May 24 2018

There is a minor typo in one of the code snippets in dojo/widget-core/documentation, there is a following code snippet there:

`interface ListProperties {
items: {
id: string;
content: string;
highlighted: boolean;
};
}

class List extends WidgetBase {
protected render() {
const { items } = this.properties;

    return v('ul', { classes: 'list' }, items.map((item) => {
        const { id, highlighted, content } = item;
        const classes = [ highlighted ? 'highlighted' : null ];

        return v('li', { key: id, classes }, [ content ]);
    });
}

}`

map() is being used on an object, I believe author wanted to define items property as an array of

{
id: string;
content: string;
highlighted: boolean;
}

like:

{
id: string;
content: string;
highlighted: boolean;
}[]

rather than a single instance.

This is my first time posting so forgive me for bad formatting, I'm having some problems with code tag.
I have seen more minor mistakes in code elsewhere in documentation, I'll make sure to post back when/if I stumble upon them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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