react-instantsearch-nextjs 0.3.1 → 0.3.3

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.
@@ -33,6 +33,13 @@ function InstantSearchNext(_ref) {
33
33
  delete window[InstantSearchInitialResults];
34
34
  };
35
35
  }, []);
36
+ var nonce = (0, _utils.safelyRunOnBrowser)(function () {
37
+ return undefined;
38
+ }, {
39
+ fallback: function fallback() {
40
+ return (0, _headers.headers)().get('x-nonce') || undefined;
41
+ }
42
+ });
36
43
  var routing = (0, _useInstantSearchRouting.useInstantSearchRouting)(passedRouting, isMounting);
37
44
  var promiseRef = (0, _react.useRef)(null);
38
45
  var initialResults = (0, _utils.safelyRunOnBrowser)(function () {
@@ -46,6 +53,6 @@ function InstantSearchNext(_ref) {
46
53
  }, /*#__PURE__*/_react.default.createElement(_reactInstantsearchCore.InstantSearch, _extends({}, instantSearchProps, {
47
54
  routing: routing
48
55
  }), !initialResults && /*#__PURE__*/_react.default.createElement(_InitializePromise.InitializePromise, {
49
- nonce: (0, _headers.headers)().get('x-nonce') || undefined
56
+ nonce: nonce
50
57
  }), children, !initialResults && _ref2)));
51
58
  }
@@ -24,6 +24,13 @@ export function InstantSearchNext(_ref) {
24
24
  delete window[InstantSearchInitialResults];
25
25
  };
26
26
  }, []);
27
+ var nonce = safelyRunOnBrowser(function () {
28
+ return undefined;
29
+ }, {
30
+ fallback: function fallback() {
31
+ return headers().get('x-nonce') || undefined;
32
+ }
33
+ });
27
34
  var routing = useInstantSearchRouting(passedRouting, isMounting);
28
35
  var promiseRef = useRef(null);
29
36
  var initialResults = safelyRunOnBrowser(function () {
@@ -37,6 +44,6 @@ export function InstantSearchNext(_ref) {
37
44
  }, /*#__PURE__*/React.createElement(InstantSearch, _extends({}, instantSearchProps, {
38
45
  routing: routing
39
46
  }), !initialResults && /*#__PURE__*/React.createElement(InitializePromise, {
40
- nonce: headers().get('x-nonce') || undefined
47
+ nonce: nonce
41
48
  }), children, !initialResults && _ref2)));
42
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-instantsearch-nextjs",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "React InstantSearch SSR utilities for Next.js",
5
5
  "types": "dist/es/index.d.ts",
6
6
  "main": "dist/cjs/index.js",
@@ -49,13 +49,13 @@
49
49
  "watch:es": "yarn --silent build:es:base --watch"
50
50
  },
51
51
  "devDependencies": {
52
- "instantsearch.js": "4.71.0",
52
+ "instantsearch.js": "4.72.0",
53
53
  "next": "13.5.1",
54
- "react-instantsearch-core": "7.11.0"
54
+ "react-instantsearch-core": "7.11.2"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "next": ">= 13.4 && < 15",
58
58
  "react-instantsearch": ">= 7.1.0 && < 8"
59
59
  },
60
- "gitHead": "3707501a19e582e8263a3ae5a9d51ff3f5263361"
60
+ "gitHead": "0b125d8a3fb2a5905aea9b6b540e07ab91649215"
61
61
  }