Skip to content

Commit ad796f2

Browse files
committed
fix: fix Svg styling
1 parent ae94420 commit ad796f2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/app/_layout.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export { ErrorBoundary } from 'expo-router';
1616
// Import global CSS file
1717
import '../../global.css';
1818

19+
import { cssInterop } from 'nativewind';
20+
import Svg from 'react-native-svg';
21+
1922
export const unstable_settings = {
2023
initialRouteName: '(app)',
2124
};
@@ -25,6 +28,13 @@ loadSelectedTheme();
2528
// Prevent the splash screen from auto-hiding before asset loading is complete.
2629
SplashScreen.preventAutoHideAsync();
2730

31+
//Apply cssInterop to Svg to resolve className string into style
32+
cssInterop(Svg, {
33+
className: {
34+
target: 'style',
35+
},
36+
});
37+
2838
export default function RootLayout() {
2939
const navigationRef = useNavigationContainerRef();
3040
useReactNavigationDevTools(navigationRef);

0 commit comments

Comments
 (0)