hart-estate-widget 0.0.67 → 0.0.70

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.
package/README.md CHANGED
@@ -11,8 +11,7 @@
11
11
  import React, { useEffect, useState } from 'react';
12
12
  import { Widget, rotationModes } from 'hart-estate-widget';
13
13
  // либо
14
- import 'hart-estate-widget/build/bundle.js';
15
- import 'hart-estate-widget/build/index.css';
14
+ import 'hart-estate-widget/build/widget.bundle.js'; // в таком случае создается глобальная переменная WidgetLibrary
16
15
 
17
16
  const WIDGET_OPTIONS = {
18
17
  tabs: ['planImage', 'rotation', 'panorama'],
@@ -36,24 +35,12 @@ const App = () => {
36
35
 
37
36
  useEffect(() => {
38
37
  const createdWidget = new Widget('#widget-container', WIDGET_OPTIONS);
39
-
40
- const onResize = () => {
41
- const { innerWidth: width, innerHeight: height } = window;
42
- createdWidget.updateSize({ width, height });
43
- };
44
-
45
- window.addEventListener('resize', onResize);
46
-
47
38
  setState(createdWidget);
48
-
49
- return function cleanup() {
50
- window.removeEventListener('resize', onResize);
51
- };
52
39
  }, []);
53
40
 
54
41
  return (
55
42
  <div>
56
- <div id="#widget-container" />
43
+ <div id="widget-container" />
57
44
  </div>
58
45
  );
59
46
  }