File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class SLDSLookup extends React.Component {
4040 }
4141
4242 componentDidMount ( ) {
43- this . modifyItems ( ) ;
43+ this . modifyItems ( this . props . items ) ;
4444 }
4545
4646 componentDidUpdate ( prevProps , prevState ) {
@@ -237,8 +237,8 @@ class SLDSLookup extends React.Component {
237237 ) ;
238238 }
239239
240- modifyItems ( ) {
241- const items = this . props . items . map ( ( item , index ) => {
240+ modifyItems ( itemsToModify ) {
241+ const items = itemsToModify . map ( ( item , index ) => {
242242 return {
243243 id : 'item-' + index ,
244244 label : item . label ,
@@ -250,7 +250,9 @@ class SLDSLookup extends React.Component {
250250 }
251251
252252 componentWillReceiveProps ( newProps ) {
253- this . modifyItems ( ) ;
253+ if ( newProps . items ) {
254+ this . modifyItems ( newProps . items ) ;
255+ }
254256 }
255257
256258 render ( ) {
You can’t perform that action at this time.
0 commit comments