Skip to content

Commit e1f5345

Browse files
committed
Nested the actual text caption of each list item in a sub-field 'caption'. This is to allow for keeping track of other data for each item via other sub-fields.
1 parent 5bd1dc3 commit e1f5345

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

webpack_in/entry.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ class ListWidget extends React.Component {
7878
constructor(props) {
7979
super(props);
8080

81-
this._mutateStateToAddItem = (state, strItemNew) => ({
81+
this._mutateStateToAddItem = (state, strItemCaption) => ({
8282
...state,
8383
items: [
8484
...state.items,
85-
strItemNew
85+
{
86+
caption: strItemCaption
87+
}
8688
],
8789
total_added: state.total_added + 1
8890
});
@@ -106,8 +108,8 @@ class ListWidget extends React.Component {
106108
<div style={ objStyleCommon }>
107109
<div style={ objStyleContent }>
108110
<ul style={{ display: 'inline-block', textAlign: 'left' }}>
109-
{ this.state.items.map((strItem, index) => (<li key={ index }>
110-
{ strItem }
111+
{ this.state.items.map((objItem, index) => (<li key={ index }>
112+
{ objItem.caption }
111113
</li>)) }
112114
</ul>
113115
</div>

0 commit comments

Comments
 (0)