Skip to content

Commit c64f0e6

Browse files
Merge pull request #829 from StrahilKazlachev/doc/add-warning/set-root
doc(app-configuration-and-startup): add warning about setRoot
2 parents d67227e + 9145bcc commit c64f0e6

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

doc/article/en-US/app-configuration-and-startup.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ The root component is set by calling `aurelia.setRoot()`. If no values are provi
143143

144144
This causes the `my-root${context.language.fileExtension}`/`my-root.html` to be loaded as the root component and injected into the `some-element` HTML element.
145145

146+
> Note: The content of the app host element, the one marked with `aurelia-app` or passed to `Aurelia.prototype.setRoot`, will be replaced when `Aurelia.prototype.setRoot` completes.
147+
148+
> Warning: When using the `<body>` element as the app host, bear in mind that any content added prior to the completion of `Aurelia.prototype.setRoot` will be removed.
149+
146150
## [Bootstrapping Older Browsers](aurelia-doc://section/3/version/1.0.0)
147151

148152
Aurelia was originally designed for Evergreen Browsers. This includes Chrome, Firefox, IE11 and Safari 8. However, we also support IE9 and above through the use of additional polyfills. To support these earlier browsers, you need the [requestAnimationFrame Polyfill](https://www.npmjs.com/package/raf) and the [MutationObserver polyfill](https://github.com/megawac/MutationObserver.js). Once you have installed these (via `npm install --save-dev raf mutationobserver-shim`), you'll need to adjust your code to load them before Aurelia is initialized.

0 commit comments

Comments
 (0)