Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

chore(react 19.0.0/react-native 0.79.7): fixes

Calinteodor0c10d420d505
diff --git a/react/features/base/react/components/native/NavigateSectionList.tsx b/react/features/base/react/components/native/NavigateSectionList.tsx
index 66e9c0df10..bc65572873 100644
--- a/react/features/base/react/components/native/NavigateSectionList.tsx
+++ b/react/features/base/react/components/native/NavigateSectionList.tsx
@@ -40,7 +40,7 @@ interface IProps {
/**
* Function to override the rendered default empty list component.
*/
- renderListEmptyComponent: React.ReactElement<any>;
+ renderListEmptyComponent: React.ReactElement<any> | null;
/**
* An array of sections.
@@ -209,7 +209,7 @@ class NavigateSectionList extends Component<IProps> {
// execution of incorrect source code, it is undesirable to break the
// whole app because of an undefined string.
if (typeof item.title === 'undefined') {
- return <></>;
+ return null;
}
return (
@@ -230,7 +230,7 @@ class NavigateSectionList extends Component<IProps> {
* @private
* @returns {React$Node}
*/
- _renderListEmptyComponent(): React.ReactElement<any> {
+ _renderListEmptyComponent(): React.ReactElement<any> | null {
const { onRefresh } = this.props;
if (typeof onRefresh === 'function') {
@@ -239,7 +239,7 @@ class NavigateSectionList extends Component<IProps> {
);
}
- return <></>;
+ return null;
}
/**
diff --git a/react/features/base/react/components/native/NavigateSectionListEmptyComponent.tsx b/react/features/base/react/components/native/NavigateSectionListEmptyComponent.tsx
index 3963a41f0b..7b230809b3 100644
--- a/react/features/base/react/components/native/NavigateSectionListEmptyComponent.tsx
+++ b/react/features/base/react/components/native/NavigateSectionListEmptyComponent.tsx
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { WithTranslation } from 'react-i18next';
import { Text, View, ViewStyle } from 'react-native';
-import { translate } from '../../../i18n/functions';
+import { translate } from '../../../i18n/functions.native';
import Icon from '../../../icons/components/Icon';
import { IconArrowDown } from '../../../icons/svg';
diff --git a/react/features/base/react/components/native/SectionList.tsx b/react/features/base/react/components/native/SectionList.tsx
index da9dc64f0f..2cffd5fbc5 100644
--- a/react/features/base/react/components/native/SectionList.tsx
+++ b/react/features/base/react/components/native/SectionList.tsx
@@ -19,7 +19,7 @@ interface IProps {
* Rendered when the list is empty. Can be a React Component Class, a render
* function, or a rendered element.
*/
- ListEmptyComponent: React.ReactElement<any>;
+ ListEmptyComponent: React.ReactElement<any> | null;
/**
*
@@ -44,7 +44,7 @@ interface IProps {
*
* Default renderer for every item in every section.
*/
- renderItem: (info: SectionListRenderItemInfo<Item, Section>) => React.ReactElement<any>;
+ renderItem: (info: SectionListRenderItemInfo<Item, Section>) => React.ReactElement<any> | null;
/**
*
diff --git a/react/features/calendar-sync/components/CalendarList.native.tsx b/react/features/calendar-sync/components/CalendarList.native.tsx
index 34e7edb2e7..c2cfeb15cf 100644
--- a/react/features/calendar-sync/components/CalendarList.native.tsx
+++ b/react/features/calendar-sync/components/CalendarList.native.tsx
@@ -103,7 +103,7 @@ class CalendarList extends AbstractPage<IProps> {
// the default empty component of the NavigateSectionList will be
// rendered, which (atm) is a simple "Pull to refresh" message.
if (_authorization !== 'denied') {
- return <></>;
+ return null;
}
return (
diff --git a/react/features/calendar-sync/components/CalendarListContent.native.tsx b/react/features/calendar-sync/components/CalendarListContent.native.tsx
index 1bdbc6546a..b5d3008d10 100644
--- a/react/features/calendar-sync/components/CalendarListContent.native.tsx
+++ b/react/features/calendar-sync/components/CalendarListContent.native.tsx
@@ -36,7 +36,7 @@ interface IProps extends WithTranslation {
/**
*
*/
- listEmptyComponent: React.ReactElement<any>;
+ listEmptyComponent: React.ReactElement<any> | null;
}
/**
diff --git a/react/features/mobile/navigation/components/chat/components/ChatNavigator.tsx b/react/features/mobile/navigation/components/chat/components/ChatNavigator.tsx
index 1150275254..0fcaacd931 100644
--- a/react/features/mobile/navigation/components/chat/components/ChatNavigator.tsx
+++ b/react/features/mobile/navigation/components/chat/components/ChatNavigator.tsx
@@ -20,6 +20,8 @@ import { isCCTabEnabled } from '../../../../../subtitles/functions.any';
import { screen } from '../../../routes';
import { chatTabBarOptions } from '../../../screenOptions';
+import ChatTabBar from './ChatTabBar';
+
const ChatTab = createMaterialTopTabNavigator();
const ChatNavigator = () => {
@@ -46,7 +48,8 @@ const ChatNavigator = () => {
width: clientWidth
}}
initialRouteName = { initialRouteName }
- screenOptions = { chatTabBarOptions }>
+ screenOptions = { chatTabBarOptions }
+ tabBar = { ChatTabBar }>
{
!isChatTabDisabled
&& <ChatTab.Screen
diff --git a/react/features/mobile/navigation/components/chat/components/ChatTabBar.tsx b/react/features/mobile/navigation/components/chat/components/ChatTabBar.tsx
new file mode 100644
index 0000000000..f733604dbc
--- /dev/null
+++ b/react/features/mobile/navigation/components/chat/components/ChatTabBar.tsx
@@ -0,0 +1,21 @@
+import { MaterialTopTabBar, MaterialTopTabBarProps } from '@react-navigation/material-top-tabs';
+import React from 'react';
+import { Route, TabBarItem, TabBarItemProps } from 'react-native-tab-view';
+
+type TabBarItemWithKey = TabBarItemProps<Route> & { key: string; };
+
+// renderTabBarItem extracts key from the spread props object to satisfy React 19's
+// requirement that key must be passed directly to JSX and not via object spread.
+const renderTabBarItem = ({ key, ...itemProps }: TabBarItemWithKey) => (
+ <TabBarItem
+ key = { key }
+ { ...itemProps } />
+);
+
+const ChatTabBar = (props: MaterialTopTabBarProps) => (
+ <MaterialTopTabBar
+ { ...props as any }
+ renderTabBarItem = { renderTabBarItem } />
+);
+
+export default ChatTabBar;