react-native-elements / react-native-elements-app

Demo app for React Native Elements (w/ React Native Web)
https://reactnativeelements.com/
1.29k stars 417 forks source link

DividerView cannot import colors correctly, prompting that "Module not found: Can't resolve 'react-native-elements/src/config/theme' in..." #218

Closed ydhao closed 3 years ago

ydhao commented 3 years ago

As title

diff --git a/src/views/Divider.tsx b/src/views/Divider.tsx
index 14166c8..5dce514 100644
--- a/src/views/Divider.tsx
+++ b/src/views/Divider.tsx
@@ -2,7 +2,7 @@ import React from 'react';
 import { Text, Divider } from 'react-native-elements';
 import { ScrollView, StyleSheet, View } from 'react-native';
 import { Header, SubHeader } from '../components/header';
-import theme from 'react-native-elements/src/config/theme';
+import colors from '../config/colors';

 type DividerViewTypes = {};

@@ -18,7 +18,7 @@ const DividerView: React.FunctionComponent<DividerViewTypes> = (props) => {
           <Text style={styles.horizontalText}>
             Horizontal Divider with width and color
           </Text>
-          <Divider width={5} color={theme.colors.primary} />
+          <Divider width={5} color={colors.primary} />
         </View>
         <SubHeader title="Horizontal Divider with Inset" />
         <View style={styles.horizontal}>
@@ -53,7 +53,7 @@ const DividerView: React.FunctionComponent<DividerViewTypes> = (props) => {
           <Divider
             subHeader="Divider"
             inset={true}
-            subHeaderStyle={{ color: theme.colors.primary }}
+            subHeaderStyle={{ color: colors.primary }}
           />
           <Text style={styles.horizontalText}>Right text</Text>
         </View>
khushal87 commented 3 years ago

Sorry, @ydhao for the issue. I have fixed it and you will get this updated soon once my PR is merged