Registers a callback that will be called once the application infrastructure is ready
to perform its initial render.
Parameters
Name | Type | Description | Required | callback | function | Function 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)});