@mezzanine-ui/react 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,20 +11,26 @@ import NotifierManager from './NotifierManager.js';
11
11
  */
12
12
  function createNotifier(props) {
13
13
  const { config: configProp, render: renderNotifier, setRoot, duration, maxCount, renderContainer, sortBeforeUpdate, ...restNotifierProps } = props;
14
- const container = typeof document === 'undefined' ? null : document.createElement('div');
15
- const root = container ? createRoot(container) : null;
14
+ let container = null;
15
+ let root = null;
16
16
  const controllerRef = createRef();
17
17
  let currentConfig = {
18
18
  duration,
19
19
  maxCount,
20
20
  ...configProp,
21
21
  };
22
- if (setRoot && container) {
23
- setRoot(container);
22
+ function ensureInitialized() {
23
+ if (container || typeof document === 'undefined')
24
+ return;
25
+ container = document.createElement('div');
26
+ if (setRoot)
27
+ setRoot(container);
28
+ root = createRoot(container);
24
29
  }
25
30
  return {
26
31
  add(notifier) {
27
32
  var _a, _b;
33
+ ensureInitialized();
28
34
  if (container === null)
29
35
  return 'NOT_SET';
30
36
  document.body.appendChild(container);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mezzanine-ui/react",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "React components for mezzanine-ui",
5
5
  "author": "Mezzanine",
6
6
  "repository": {