React Native 스타일드 컴포넌트 설정
어째 한방에 쉽게 가는게 없냐... ㅋ
yarn add styled-components
yarn add @types/styled-components
yarn add @types/styled-components-react-native
잘되야 햇는데
오류가 ....
import React from 'react';
import { Text, View } from 'react-native';
import styled from 'styled-components/native';
interface IProps {}
function TodosMainScrn({}: IProps) {
return (
<View style={{}}>
<Text>TodosMainScrn</Text>
</View>
);
}
export default TodosMainScrn;
해결안 : https://github.com/styled-components/styled-components/issues/2370
tsconfig.json에 아래 문구 추가 : 2안 적용했음
"typeRoots": ["node_modules/@types"... ],
"compilerOptions": {
// ...
"types": [
"@types/styled-components-react-native"
]
},