@hero-design/rn 8.24.0-alpha.0 → 8.24.0-alpha.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.
package/es/index.js CHANGED
@@ -15523,19 +15523,16 @@ var SceneView = function SceneView(_ref) {
15523
15523
  children = _ref.children,
15524
15524
  index = _ref.index,
15525
15525
  selectedIndex = _ref.selectedIndex,
15526
- focused = _ref.focused,
15527
15526
  testID = _ref.testID;
15528
15527
  var _React$useState = React.useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
15529
15528
  _React$useState2 = _slicedToArray(_React$useState, 2),
15530
15529
  isLoading = _React$useState2[0],
15531
15530
  setIsLoading = _React$useState2[1];
15531
+ var focused = index === selectedIndex;
15532
15532
  if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
15533
15533
  // Always render the route when it becomes focused
15534
15534
  setIsLoading(false);
15535
15535
  }
15536
- if (lazy && isLoading) {
15537
- console.error('Lazy loading is not supported in this version of Tabs');
15538
- }
15539
15536
  React.useEffect(function () {
15540
15537
  var timer;
15541
15538
  if (!lazy && isLoading) {
@@ -15650,8 +15647,7 @@ var ScrollableTab = function ScrollableTab(_ref) {
15650
15647
  index: index,
15651
15648
  selectedIndex: indexRef.current,
15652
15649
  lazy: lazy,
15653
- lazyPreloadDistance: lazyPreloadDistance,
15654
- focused: selectedTabKey === key
15650
+ lazyPreloadDistance: lazyPreloadDistance
15655
15651
  }, component));
15656
15652
  }))));
15657
15653
  };
File without changes
package/lib/index.js CHANGED
@@ -15553,19 +15553,16 @@ var SceneView = function SceneView(_ref) {
15553
15553
  children = _ref.children,
15554
15554
  index = _ref.index,
15555
15555
  selectedIndex = _ref.selectedIndex,
15556
- focused = _ref.focused,
15557
15556
  testID = _ref.testID;
15558
15557
  var _React$useState = React__default["default"].useState(Math.abs(selectedIndex - index) > lazyPreloadDistance),
15559
15558
  _React$useState2 = _slicedToArray(_React$useState, 2),
15560
15559
  isLoading = _React$useState2[0],
15561
15560
  setIsLoading = _React$useState2[1];
15561
+ var focused = index === selectedIndex;
15562
15562
  if (isLoading && Math.abs(selectedIndex - index) <= lazyPreloadDistance) {
15563
15563
  // Always render the route when it becomes focused
15564
15564
  setIsLoading(false);
15565
15565
  }
15566
- if (lazy && isLoading) {
15567
- console.error('Lazy loading is not supported in this version of Tabs');
15568
- }
15569
15566
  React__default["default"].useEffect(function () {
15570
15567
  var timer;
15571
15568
  if (!lazy && isLoading) {
@@ -15680,8 +15677,7 @@ var ScrollableTab = function ScrollableTab(_ref) {
15680
15677
  index: index,
15681
15678
  selectedIndex: indexRef.current,
15682
15679
  lazy: lazy,
15683
- lazyPreloadDistance: lazyPreloadDistance,
15684
- focused: selectedTabKey === key
15680
+ lazyPreloadDistance: lazyPreloadDistance
15685
15681
  }, component));
15686
15682
  }))));
15687
15683
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/rn",
3
- "version": "8.24.0-alpha.0",
3
+ "version": "8.24.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
- export declare const SceneView: ({ lazy, lazyPreloadDistance, children, index, selectedIndex, focused, testID, }: {
2
+ export declare const SceneView: ({ lazy, lazyPreloadDistance, children, index, selectedIndex, testID, }: {
3
3
  children: React.ReactNode;
4
4
  index: number;
5
5
  selectedIndex: number;
6
6
  lazy?: boolean | undefined;
7
7
  lazyPreloadDistance?: number | undefined;
8
- focused?: boolean | undefined;
9
8
  testID?: string | undefined;
10
9
  }) => JSX.Element;
10
+ export default SceneView;