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

Shadow prop error in android #893

Closed
benomzn opened this issue Apr 25, 2024 · 0 comments
Closed

Shadow prop error in android #893

benomzn opened this issue Apr 25, 2024 · 0 comments

Comments

@benomzn
Copy link

benomzn commented Apr 25, 2024

Hi, I made a custom component, that receives the "className?: string" prop. This is the component:

import { cn } from "@/core/utils";
import { ActivityIndicator, Pressable, PressableProps } from "react-native";

interface ButtonPros {
  onPress: () => void,
  className?: string,
  children?: React.ReactNode,
  isLoading?: boolean
}

const Button = ({ onPress, className, children, isLoading = false, ...rest }: ButtonPros & PressableProps): JSX.Element => {
  return (
    <>
      <Pressable
        onPress={onPress}
        disabled={isLoading}
        className={cn("outline-none items-center justify-center shadow shadow-black rounded-full bg-slate-600 px-5 py-2 active:scale-95 active:opacity-80 transition-all", className)}
        {...rest}>
        {isLoading ? <ActivityIndicator size={15}/> : children}
      </Pressable>
    </>
  );
}
export default Button;

But in Android, I receive this error:

image

This only happens in the android emulator, it works fine on iOS. When I deleted "shadow shadow-black" from className prop in Pressable component, I stopped getting errors. Even if I get the warning, the shadow still works on ios and android, but I'm curious why I'm getting this message in the console.

Versions:
"expo": "~50.0.14",
"nativewind": "^4.0.1",
"tailwindcss": "^3.4.3"

@benomzn benomzn closed this as not planned Won't fix, can't repro, duplicate, stale May 20, 2024
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