
Spaces and Meta Chars Before the JavaScript in Images for XSS Hexadecimal HTML Character References Without Trailing Semicolons If you wish to implement SPAs in AEM for a framework other than React or Angular or simply wish to take a deep dive into how the SPA SDK for AEM works, refer to the SPA Blueprint article.Insecure Direct Object Reference Preventionĭefault SRC Tag to Get Past Filters that Check SRC Domainĭefault SRC Tag by Leaving it out Entirelyĭecimal HTML Character References Without Trailing Semicolons
#Empy angle bracket react fragment how to
Option 3: Leverage the object hierarchy by customizing and extending the container component.įor a step-by-step guide to creating your own SPA, see the Getting Started with the AEM SPA Editor - WKND Events Tutorial.įor further information about how to oraganize yourself to develop SPAs for AEM see the article Developing SPAs for AEM.įor further details about the dynamic model to component mapping and how it works within SPAs in AEM, see the article Dynamic Model to Component Mapping for SPAs.Option 2: Share component states by using a state library such as Redux.Option 1: Centralize the logic and broadcast to the necessary components for example by using React Context.

There are several recommended ways of doing this, listed as follows in increasing order of complexity. It is regularly necessary for components within a single-page application to share information. Sharing Information Between SPA Components

When exported using the MapTo or withModel functions, the Page component, is wrapped with a ModelProvider component which provides standard components access to the latest version of the page model or a precise location in that page model.įor more information see the SPA Blueprint document.īy default you receive the entire model of the component when using the withModel function. This component can be exported to later be instantiated in the markup of your application. The MapTo function returns a Component which is the result of a composition that extends the provided PageClass with the class names and attributes that enable the authoring. module.exports = Įxport default MapTo('my-react-app/react/components/structure/page')(PageClass, EditConfig) The aem-clientlib-generator is configured in the file as follows. The minimum version of the aem-clientlib-generator required is 1.4.1. The aem-clientlib-generator is leveraged to make the creation of client libraries automatic as part of the build process.įurther details about it can be found on GitHub here.

"dependencies": "~1.0.3"īecause this example is based on the React framework, there are two React-specific dependencies which are obligatory in the package.json file: react The minimum AEM dependencies for a working SPA are listed here. The package.json file defines the requirements of the overall SPA package.

In addition to the expected React dependency, the sample SPA can leverage additional libraries to make the creation of the SPA more efficient. Dependencies, Configuration, and Building This document will walk through the structure of a simplified SPA created using the React framework and illustrate how it works so you can apply this understanding to your own SPA. In order to be able to author content within an SPA, the content must be stored in AEM and be exposed by the content model.Īn SPA developed outside of AEM will not be authorable if it does not respect the content model contract.
