diff --git a/package.json b/package.json index 1896144..40d912a 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/trendyol/baklava-react-native.git" + "url": "https://github.com/Trendyol/baklava-react-native.git" }, "license": "MIT", "scripts": { diff --git a/src/components/Box/Box.tsx b/src/components/Box/Box.tsx index 84a483f..a912309 100644 --- a/src/components/Box/Box.tsx +++ b/src/components/Box/Box.tsx @@ -34,28 +34,33 @@ const restyleFunctions = composeRestyleFunctions([ export type BoxProps = RNViewProps & RestyleProps; -const Box = ({ testID, accessibilityLabel, accessible, ...rest }: BoxProps) => { - const props = useRestyle(restyleFunctions, rest); +const Box = React.forwardRef( + ( + { testID, accessibilityLabel, accessible, ...rest }: BoxProps, + ref: React.ForwardedRef, + ) => { + const props = useRestyle(restyleFunctions, rest); - const testProps = React.useMemo(() => { - const result: RNViewProps = { - accessible: false, - accessibilityLabel: undefined, - testID: undefined, - }; + const testProps = React.useMemo(() => { + const result: RNViewProps = { + accessible: false, + accessibilityLabel: undefined, + testID: undefined, + }; - if (!(testID || accessibilityLabel)) { - return result; - } + if (!(testID || accessibilityLabel)) { + return result; + } - result.accessible = accessible ?? true; - result.accessibilityLabel = accessibilityLabel ?? testID; - result.testID = testID ?? accessibilityLabel; + result.accessible = accessible ?? true; + result.accessibilityLabel = accessibilityLabel ?? testID; + result.testID = testID ?? accessibilityLabel; - return result; - }, [testID, accessibilityLabel, accessible]); + return result; + }, [testID, accessibilityLabel, accessible]); - return ; -}; + return ; + }, +); export default Box;