Skip to content

Commit dbb809c

Browse files
authored
update React, move React Native + Expo to nightly stack (#2794)
1 parent b444ec3 commit dbb809c

16 files changed

Lines changed: 326 additions & 169 deletions

bun.lock

Lines changed: 207 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/styleguide.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as HtmlElements from '@expo/html-elements';
2-
import { type TextProps } from '@expo/html-elements/build/primitives/Text';
2+
import { type TextProps } from '@expo/html-elements/primitives/Text';
33
import Link from 'next/link';
44
import { type ComponentType, type PropsWithChildren, type Ref, useState } from 'react';
55
import {

components/Library/MetaData.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ function MetaData({ library, secondary, skipExamples = false }: Props) {
280280
const component = (
281281
<View
282282
key={id}
283-
// @ts-expect-error RNW complains about 'fit-content'
284283
style={{
285284
...(i + 1 !== data.length ? tw`mb-2 overflow-hidden` : {}),
286285
...tw`mb-0 max-h-5 min-h-5 flex-row items-center pr-[3px]`,

components/Library/TrendingMark.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function TrendingMark({ library, style, markOnly = false }: Props
3838
);
3939

4040
return markOnly ? (
41-
<View style={[tw`mb-1`, style as ViewStyle]}>{content}</View>
41+
<View style={[tw`mb-1`, style]}>{content}</View>
4242
) : (
4343
<HoverEffect>
4444
<A href="/scoring" style={[tw`relative flex items-start no-underline`, style as Style]}>

components/Package/CodeBrowser/PackageVersionSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as Popover from '@radix-ui/react-popover';
22
import { useRef, useState } from 'react';
3-
import { type ColorValue, ScrollView, TextInput, View } from 'react-native';
3+
import { type ColorValue, ScrollView, TextInput, type TextInputInstance, View } from 'react-native';
44
import useSWR from 'swr';
55
import { useDebounce } from 'use-debounce';
66

@@ -27,7 +27,7 @@ export default function PackageVersionSelector({
2727
const [open, setOpen] = useState(false);
2828
const [search, setSearch] = useState('');
2929
const [debouncedSearch] = useDebounce(search, 150);
30-
const inputRef = useRef<TextInput>(null);
30+
const inputRef = useRef<TextInputInstance>(null);
3131

3232
const { data, isLoading } = useSWR<PackageVersionsOnlyData>(
3333
`/api/proxy/npm-registry-versions?name=${packageName}&versionsOnly=true`,

components/Package/CodeBrowser/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
Pressable,
88
ScrollView,
99
TextInput,
10+
type TextInputInstance,
1011
View,
1112
} from 'react-native';
1213
import useSWR from 'swr';
@@ -60,7 +61,7 @@ export default function CodeBrowser({
6061
toggleMaximized,
6162
}: Props) {
6263
const { isSmallScreen } = useLayout();
63-
const inputRef = useRef<TextInput>(null);
64+
const inputRef = useRef<TextInputInstance>(null);
6465
const fileTreeResizeStartRef = useRef<{ startX: number; startWidth: number } | null>(null);
6566

6667
const [search, setSearch] = useState('');

components/Package/CommunitySection/FoundingRow.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type Props = {
1515
export default function FundingRow({ fund }: Props) {
1616
const { isSmallScreen } = useLayout();
1717
return (
18-
// @ts-expect-error calculated width
1918
<LI style={!isSmallScreen && { width: 'calc(50% - 4px)' }}>
2019
<A
2120
href={correctFundLink(fund)}

components/Package/VersionsSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useRouter } from 'next/router';
22
import { useRef, useState } from 'react';
3-
import { type ColorValue, TextInput, View } from 'react-native';
3+
import { type ColorValue, TextInput, type TextInputInstance, View } from 'react-native';
44
import { useDebouncedCallback } from 'use-debounce';
55

66
import { Caption, H6Section, Label, useLayout } from '~/common/styleguide';
@@ -31,7 +31,7 @@ export default function VersionsSection({ registryData, npmDownloads }: Props) {
3131
const { isSmallScreen } = useLayout();
3232

3333
const [shouldShowAll, setShowAll] = useState(false);
34-
const inputRef = useRef<TextInput>(null);
34+
const inputRef = useRef<TextInputInstance>(null);
3535
const isApple = useSearchShortcut(inputRef);
3636
const { isInputFocused, handleInputFocus, handleInputBlur } = useSearchInputFocus();
3737

components/QuickSearch.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { useRouter } from 'next/router';
22
import { useRef, useState } from 'react';
3-
import { type ColorValue, type StyleProp, TextInput, View, type ViewStyle } from 'react-native';
3+
import {
4+
type ColorValue,
5+
type StyleProp,
6+
TextInput,
7+
type TextInputInstance,
8+
View,
9+
type ViewStyle,
10+
} from 'react-native';
411
import useSWR from 'swr';
512
import { useDebouncedCallback } from 'use-debounce';
613

@@ -28,7 +35,7 @@ export default function QuickSearch({ style }: Props) {
2835
const [activeResultIndex, setActiveResultIndex] = useState<number | null>(null);
2936
const [search, setSearch] = useState('');
3037

31-
const inputRef = useRef<TextInput>(null);
38+
const inputRef = useRef<TextInputInstance>(null);
3239
const searchRef = useRef<string>('');
3340
const isApple = useSearchShortcut(inputRef);
3441
const { isInputFocused, handleInputFocus, handleInputBlur } = useSearchInputFocus();

components/Search.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { useRouter } from 'next/router';
22
import { useEffect, useRef, useState } from 'react';
3-
import { type ColorValue, type StyleProp, TextInput, View, type ViewStyle } from 'react-native';
3+
import {
4+
type ColorValue,
5+
type StyleProp,
6+
TextInput,
7+
type TextInputInstance,
8+
View,
9+
type ViewStyle,
10+
} from 'react-native';
411
import { useDebouncedCallback } from 'use-debounce';
512

613
import { P, useLayout } from '~/common/styleguide';
@@ -29,7 +36,7 @@ export default function Search({ query, total, style }: Props) {
2936
const { search, order, direction, offset, owner, ...filterParams } = query;
3037
const [isFilterVisible, setFilterVisible] = useState(Object.keys(filterParams).length > 0);
3138

32-
const inputRef = useRef<TextInput>(null);
39+
const inputRef = useRef<TextInputInstance>(null);
3340
const isApple = useSearchShortcut(inputRef);
3441
const { isInputFocused, handleInputFocus, handleInputBlur } = useSearchInputFocus();
3542

0 commit comments

Comments
 (0)