The import
import styled, {ThemeProvider} from 'styled-components/native';
package
@types/styled-components-react-native
tsconfig.json
// prettier-ignore{"extends": "@tsconfig/react-native/tsconfig.json", /* Recommended React Native TSConfig base */"compilerOptions": { /* Visit https://aka.ms/tsconfig.json to read more about this file */"typeRoots": ["node_modules/@types"],"types": ["@types/styled-components-react-native"], /* Completeness */"skipLibCheck": true /* Skip type checking all .d.ts files. */ },}
Adding types in tsconfig.json removes typescript complaint and I can actually navigate to the package. but when I run build get the following error nonetheles.
error: Error: Unable to resolve module styled-components/native from /home/bihire/development/react-native/elika_homes/src/shared/ThemeProvider.tsx: styled-components/native could not be found within the project or in these directories: node_modules 2 | import React from 'react'; 3 | import {StatusBar} from 'react-native';> 4 | import styled, {ThemeProvider} from 'styled-components/native';
Anyone know how to fix that?