Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button.tsx does not compile in tamagui #275

Open
Mellbourn opened this issue Apr 24, 2024 · 1 comment
Open

Button.tsx does not compile in tamagui #275

Mellbourn opened this issue Apr 24, 2024 · 1 comment

Comments

@Mellbourn
Copy link

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

@Mellbourn
Copy link
Author

Workaround is to remove Button.tsx as it doesn't seem to be used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant