You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to use a signal as a child of a React Native <Text> component, it works, but I get the following TypeScript errors. Is there a way to make TypeScript allow the use of signals inside <Text> components?
This is the error when <Text> contains only a signal:
const count = signal(0)
export function Component() {
return <Text>{count}</Text>
^^^^^^^
TS2769: No overload matches this call.
Overload 1 of 2, '(props: TextProps | Readonly<TextProps>): Text', gave the following error.
Type 'Signal<number>' is not assignable to type 'ReactNode'.
Overload 2 of 2, '(props: TextProps, context: any): Text', gave the following error.
Type 'Signal<number>' is not assignable to type 'ReactNode'.
}
This is the error when <Text> contains both text and a signal:
const count = signal(0)
export function Component() {
return <Text>Count: {count}</Text>
^^^^
TS2746: This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.
-----------------------------------------------------------------------------------------------------------------------
TS2769: No overload matches this call.
This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.
This JSX tag's 'children' prop expects a single child of type 'ReactNode', but multiple children were provided.
}
The text was updated successfully, but these errors were encountered:
When I try to use a signal as a child of a React Native
<Text>
component, it works, but I get the following TypeScript errors. Is there a way to make TypeScript allow the use of signals inside<Text>
components?This is the error when
<Text>
contains only a signal:This is the error when
<Text>
contains both text and a signal:The text was updated successfully, but these errors were encountered: