Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

onPCoreReady(callback)

Updated on July 20, 2021

Registers a callback that will be called once the application infrastructure is ready to perform its initial render.

Returns

Not applicable.

Parameters

NameTypeDescriptionRequired
callbackfunctionFunction that will be called when the application infrastructure is ready to perform its initial render.
Note: The callback has two arguments – root and target.
  • The root is a JSON object containing a props key. This is the component object that provides access to the initial getPConnect API for the top-level component of the application. The root may also contain a domContainerID key, which is used to get the DOM element with the given ID which is then used as the target element in the order that the component object will be rendered. If the key is null, the target argument passed to the callback is used as the initial point of rendering.
  • The target is null when the application is first being rendered and may be a string such app/primary to indicate the target container in which the application should be rendered. If target is not defined, the component object is rendered in the DOM's element or if there is no element, it is rendered in the element with the app ID.

Usage example

In this example, the API passes the incoming root and target arguments to the method that renders the application.

PCore.onPCoreReady((root, target) => {render(root, target)});

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us