Closed sombrerox closed 6 years ago
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.
Issue moved to dojo/widget-core #957 via ZenHub
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;
}`
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.