create-expo-stack
create-expo-stack copied to clipboard
Button.tsx does not compile in tamagui
When configuring a new app with Tamagui, components/Button.tsx
does not compile when running tsc --noEmit
Expected Behavior
No compilation errors.
Current Behavior
I get these compilation errors
components/Button.tsx:3:10 - error TS2614: Module '"../tamagui.config"' has no exported member 'Button'. Did you mean to use 'import Button from "../tamagui.config"' instead?
3 import { Button as TButton, ButtonText } from '../tamagui.config';
~~~~~~
components/Button.tsx:3:29 - error TS2614: Module '"../tamagui.config"' has no exported member 'ButtonText'. Did you mean to use 'import ButtonText from "../tamagui.config"' instead?
3 import { Button as TButton, ButtonText } from '../tamagui.config';
~~~~~~~~~~
components/Button.tsx:5:34 - error TS2304: Cannot find name 'TouchableOpacity'.
5 export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ onPress, title }, ref) => {
~~~~~~~~~~~~~~~~
components/Button.tsx:5:52 - error TS2304: Cannot find name 'ButtonProps'.
5 export const Button = forwardRef<TouchableOpacity, ButtonProps>(({ onPress, title }, ref) => {
Possible Solution
Implement Button
and ButtonText
in tamagui.config
Steps to Reproduce
Generate a new app using typescript and tamagui.
Repo which reproduces this bug: https://github.com/Mellbourn/expo-stack
Workaround is to remove Button.tsx
as it doesn't seem to be used
fixed via #328