Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

React-native Unable to resolve module styled-components/native

$
0
0

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?


Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>