Skip to content

Commit

Permalink
fix: 🐛 disabled useColorScheme hook for old version
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingByJerez committed Jul 29, 2022
1 parent 4fcd727 commit 6cc837b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/containers/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { ReactElement, useContext } from 'react';
import { useColorScheme, View } from 'react-native';
import RN, { View } from 'react-native';
import { SafeAreaInsetsContext, SafeAreaProvider } from 'react-native-safe-area-context';
import { Dialog, IConfigDialog, IConfigToast, Toast } from '../index';
import { Color, IColors } from '../service';
Expand All @@ -14,7 +14,7 @@ type IProps = {
};

const Root: React.FunctionComponent<IProps> = ({ theme, colors, children, dialogConfig, toastConfig }) => {
const colorScheme = useColorScheme();
const colorScheme = RN.useColorScheme?.();
const safeAreaInsetsContext = useContext(SafeAreaInsetsContext);
Color.colorsCustom = colors;

Expand Down
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ALERT_TYPE } from './config/ENV';
import { Root, Dialog, Toast, IConfigDialog, IConfigToast } from './containers';
import { Dialog, IConfigDialog, IConfigToast, Root, Toast } from './containers';
import './polyfills';

export { Root, Dialog, Toast, ALERT_TYPE, IConfigDialog, IConfigToast };
export default { Root, Dialog, Toast, ALERT_TYPE };

0 comments on commit 6cc837b

Please sign in to comment.