When attempting to utilize styled components in React Native with TypeScript, I keep encountering the following error:
WARN Possible Unhandled Promise Rejection (id: 1):
Error: Directory for 'file:///Users/me/Library/Developer/CoreSimulator/Devices/12EBA58B-1919-42F7-A255-0AB501875563/data/Containers/Data/Application/8BD96CA0-A291-4840-A694-EB6F0D92867F/Library/Caches/ExponentExperienceData/%2540anonymous%252FDrinklink-c6446bc2-812f-446d-b2ff-ff09cb07de2a/ExponentAsset-b62641afc9ab487008e996a5c5865e56.ttf' doesn't exist.
Added using: yarn add @types/styled-components-react-native Version installed: 5.1.3
Imported with: import styled from "styled-components/native";
Here is the styled component code in question:
const Title = styled.Text`
padding: 16px;
`;
export type Props = {
vendor: any;
};
const VendorInfo: React.FC<Props> = ({ vendor }) => {
const { title, image } = vendor;
return (
<Card elevation={5} style={styles.card}>
<Card.Cover style={styles.cover} source={{ uri: image }} />
<Title>{title}</Title>
</Card>
);
};
I have tried multiple solutions to resolve the issue with styled components in React Native, but have had no success so far. Any suggestions would be greatly appreciated.