MCPcopy Create free account
hub / github.com/decaporg/decap-cms / getRoot

Function getRoot

packages/decap-cms-core/src/bootstrap.js:53–69  ·  view source on GitHub ↗

* Get DOM element where app will mount.

()

Source from the content-addressed store, hash-verified

51 * Get DOM element where app will mount.
52 */
53 function getRoot() {
54 /**
55 * Return existing root if found.
56 */
57 const existingRoot = document.getElementById(ROOT_ID);
58 if (existingRoot) {
59 return existingRoot;
60 }
61
62 /**
63 * If no existing root, create and return a new root.
64 */
65 const newRoot = document.createElement('div');
66 newRoot.id = ROOT_ID;
67 document.body.appendChild(newRoot);
68 return newRoot;
69 }
70
71 /**
72 * Dispatch config to store if received. This config will be merged into

Callers 1

RootFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected