2

What is the NavigationMixin found in NavigationMixin(LightningElement)? Where is it defined? How can I write my own mixins?

5

Mix-ins are a fairly well-documented feature of many programming languages, including modern JavaScript/ES6. They are used to allow classes to inherit functionality from multiple other classes.

NavigationMixin is a class defined in the lightning namespace. It is documented here and here.

  • Thank you. I know what mixins are, but I had never seen the Mixin(Base) syntax. I thought it was something proprietary to SF/LWC. Now, I understand it's plain old JavaScript (although not well known, at least not to me). – kamezaburo Dec 31 '19 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.