File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,16 @@ class TextWidget extends React.Component {
74
74
}
75
75
}
76
76
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
+
77
87
class ListWidget extends React . Component {
78
88
constructor ( props ) {
79
89
super ( props ) ;
@@ -109,9 +119,9 @@ class ListWidget extends React.Component {
109
119
< div style = { objStyleCommon } >
110
120
< div style = { objStyleContent } >
111
121
< 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
+ / >) ) }
115
125
</ ul >
116
126
</ div >
117
127
< div >
You can’t perform that action at this time.
0 commit comments