@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.