@storybook/react 6.5.11 → 6.5.12
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.
|
@@ -97,10 +97,10 @@ var WithCallback = function WithCallback(_ref) {
|
|
|
97
97
|
var callback = _ref.callback,
|
|
98
98
|
children = _ref.children;
|
|
99
99
|
// See https://github.com/reactwg/react-18/discussions/5#discussioncomment-2276079
|
|
100
|
-
var once = (0, _react.useRef)(
|
|
100
|
+
var once = (0, _react.useRef)();
|
|
101
101
|
(0, _react.useLayoutEffect)(function () {
|
|
102
|
-
if (once.current) return;
|
|
103
|
-
once.current =
|
|
102
|
+
if (once.current === callback) return;
|
|
103
|
+
once.current = callback;
|
|
104
104
|
callback();
|
|
105
105
|
}, [callback]);
|
|
106
106
|
return children;
|
|
@@ -121,7 +121,6 @@ var renderElement = /*#__PURE__*/function () {
|
|
|
121
121
|
return _context.abrupt("return", new Promise(function (resolve) {
|
|
122
122
|
if (root) {
|
|
123
123
|
root.render( /*#__PURE__*/_react.default.createElement(WithCallback, {
|
|
124
|
-
key: Math.random(),
|
|
125
124
|
callback: function callback() {
|
|
126
125
|
return resolve(null);
|
|
127
126
|
}
|
|
@@ -60,10 +60,10 @@ var WithCallback = function WithCallback(_ref) {
|
|
|
60
60
|
var callback = _ref.callback,
|
|
61
61
|
children = _ref.children;
|
|
62
62
|
// See https://github.com/reactwg/react-18/discussions/5#discussioncomment-2276079
|
|
63
|
-
var once = useRef(
|
|
63
|
+
var once = useRef();
|
|
64
64
|
useLayoutEffect(function () {
|
|
65
|
-
if (once.current) return;
|
|
66
|
-
once.current =
|
|
65
|
+
if (once.current === callback) return;
|
|
66
|
+
once.current = callback;
|
|
67
67
|
callback();
|
|
68
68
|
}, [callback]);
|
|
69
69
|
return children;
|
|
@@ -84,7 +84,6 @@ var renderElement = /*#__PURE__*/function () {
|
|
|
84
84
|
return _context.abrupt("return", new Promise(function (resolve) {
|
|
85
85
|
if (root) {
|
|
86
86
|
root.render( /*#__PURE__*/React.createElement(WithCallback, {
|
|
87
|
-
key: Math.random(),
|
|
88
87
|
callback: function callback() {
|
|
89
88
|
return resolve(null);
|
|
90
89
|
}
|
|
@@ -24,10 +24,10 @@ const WithCallback = ({
|
|
|
24
24
|
children
|
|
25
25
|
}) => {
|
|
26
26
|
// See https://github.com/reactwg/react-18/discussions/5#discussioncomment-2276079
|
|
27
|
-
const once = useRef(
|
|
27
|
+
const once = useRef();
|
|
28
28
|
useLayoutEffect(() => {
|
|
29
|
-
if (once.current) return;
|
|
30
|
-
once.current =
|
|
29
|
+
if (once.current === callback) return;
|
|
30
|
+
once.current = callback;
|
|
31
31
|
callback();
|
|
32
32
|
}, [callback]);
|
|
33
33
|
return children;
|
|
@@ -39,7 +39,6 @@ const renderElement = async (node, el) => {
|
|
|
39
39
|
return new Promise(resolve => {
|
|
40
40
|
if (root) {
|
|
41
41
|
root.render( /*#__PURE__*/React.createElement(WithCallback, {
|
|
42
|
-
key: Math.random(),
|
|
43
42
|
callback: () => resolve(null)
|
|
44
43
|
}, node));
|
|
45
44
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.12",
|
|
4
4
|
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook"
|
|
@@ -49,16 +49,16 @@
|
|
|
49
49
|
"@babel/preset-flow": "^7.12.1",
|
|
50
50
|
"@babel/preset-react": "^7.12.10",
|
|
51
51
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
|
|
52
|
-
"@storybook/addons": "6.5.
|
|
53
|
-
"@storybook/client-logger": "6.5.
|
|
54
|
-
"@storybook/core": "6.5.
|
|
55
|
-
"@storybook/core-common": "6.5.
|
|
52
|
+
"@storybook/addons": "6.5.12",
|
|
53
|
+
"@storybook/client-logger": "6.5.12",
|
|
54
|
+
"@storybook/core": "6.5.12",
|
|
55
|
+
"@storybook/core-common": "6.5.12",
|
|
56
56
|
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
57
|
-
"@storybook/docs-tools": "6.5.
|
|
58
|
-
"@storybook/node-logger": "6.5.
|
|
57
|
+
"@storybook/docs-tools": "6.5.12",
|
|
58
|
+
"@storybook/node-logger": "6.5.12",
|
|
59
59
|
"@storybook/react-docgen-typescript-plugin": "1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0",
|
|
60
60
|
"@storybook/semver": "^7.3.2",
|
|
61
|
-
"@storybook/store": "6.5.
|
|
61
|
+
"@storybook/store": "6.5.12",
|
|
62
62
|
"@types/estree": "^0.0.51",
|
|
63
63
|
"@types/node": "^14.14.20 || ^16.0.0",
|
|
64
64
|
"@types/webpack-env": "^1.16.0",
|
|
@@ -119,6 +119,6 @@
|
|
|
119
119
|
"publishConfig": {
|
|
120
120
|
"access": "public"
|
|
121
121
|
},
|
|
122
|
-
"gitHead": "
|
|
122
|
+
"gitHead": "e3991cb4dac45c964e29f82da6be5912464c5a4f",
|
|
123
123
|
"sbmodern": "dist/modern/client/index.js"
|
|
124
124
|
}
|