File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ class TextWidget extends React.Component {
7474 }
7575}
7676
77+ class ListItem extends React . Component {
78+ render ( ) {
79+ return ( < li > { this . props . caption } </ li > ) ;
80+ }
81+ }
82+
83+ ListItem . propTypes = {
84+ caption : PropTypes . string . isRequired
85+ } ;
86+
7787class ListWidget extends React . Component {
7888 constructor ( props ) {
7989 super ( props ) ;
@@ -109,9 +119,9 @@ class ListWidget extends React.Component {
109119 < div style = { objStyleCommon } >
110120 < div style = { objStyleContent } >
111121 < ul style = { { display : 'inline-block' , textAlign : 'left' } } >
112- { this . state . items . map ( ( objItem , index ) => ( < li key = { objItem . id } >
113- { objItem . caption }
114- </ li > ) ) }
122+ { this . state . items . map ( ( objItem , index ) => ( < ListItem key = { objItem . id }
123+ caption = { objItem . caption }
124+ / >) ) }
115125 </ ul >
116126 </ div >
117127 < div >
You can’t perform that action at this time.
0 commit comments