Salesforce Lightning Component API change

As we get closer to Summer 17 we start using difference versions across production instances and sandboxes. This of course also leads to opportunities for differences in API’s… I just found one such difference as I’d been developing some Lightning components on Summer 17 and got errors when trying to run them on Spring 17. In Summer 17 you can do the following in a client-side event handler to get the DOM element of the source component:

({
   react: function(component, event, helper) {
      const elem = event.getSource().getElement();
   }
})

This doesn’t work in Spring 17 as the getElement method is not available. So find another way to accomplish whatever you are doing there…

2 thoughts on “Salesforce Lightning Component API change”

Comments are closed.