Rendering  reactApp using the LCC npm module in a Lightning Component

The previous section gave you an idea of how to use Lightning:container. In this section, we will explore how to build an ES6 React application, and host it inside a static resource and render it inside a Lightning Component. The app creates an account by calling an Apex class method that has all the logic to do DML on the account object.

We will be using the webpack bundler to bundle all the code and create a bundle.js file that is placed in the static resource.

The directory structure of your project with SFDX is shown in the following screenshot:

Note that all the JavaScript ...

Get Learning Salesforce Lightning Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.