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

Function getRoot

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

* Get DOM element where app will mount.

()

Source from the content-addressed store, hash-verified

68 * Get DOM element where app will mount.
69 */
70 function getRoot() {
71 /**
72 * Return existing root if found.
73 */
74 const existingRoot = document.getElementById(ROOT_ID);
75 if (existingRoot) {
76 return existingRoot;
77 }
78
79 /**
80 * If no existing root, create and return a new root.
81 */
82 const newRoot = document.createElement('div');
83 newRoot.id = ROOT_ID;
84 document.body.appendChild(newRoot);
85 return newRoot;
86 }
87
88 /**
89 * 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