You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
I am not sure if this is a bug related to Expo 34/RN0.59. Probably some misconfiguration on my side.
I thought the problem was related to Material Kit which I was trying to use, but after some investigating, I closed this creativetimofficial/material-kit-react-native#5 because it is definitely a problem I'm having with Galio's theme system
My application is built starting from an expo start. So it has an index.js and an App.js. I'm not sure this is common or if there is a better way, however, here are my two files.
I'm not sure if using withGalio here makes sense, but customTheme here has only the properties I defined. I assume this is correct, because it seems logical that the GalioProvider components merges together GalioTheme with this custom properties object.
Now, the App.js part.
If I use withGalio in it, in order to be able to use whatever constants I defined in the custom theme, everything gets broken.
Meaning that my entire application is broken. I see that the components are cycling on the flat list but I see nothing on my app apart from a couple of mispositioned titles.
However, (theme) is populated with everything so I guess that the theming mechanism is working.
app.js
import React from "react";
import { Platform, StatusBar, StyleSheet, View, Text } from "react-native";
import { createStackNavigator } from "react-navigation";
import { AppLoading } from "expo";
import { Ionicons } from "@expo/vector-icons";
import { Asset } from "expo-asset";
import * as Font from "expo-font";
import AppNavigator from "./navigation/AppNavigator";
//import ProjectsScreen from "./screens/ProjectsScreen";
import LoginScreen from "./screens/LoginScreen";
import { withGalio } from "galio-framework";
import authAction from "./redux/auth/actions";
import { connect } from "react-redux";
import NavigationService from "./navigation/NavigationService";
const { logout } = authAction;
import { SignupScreen } from "./screens/SignupScreen";
import GalioConfig from "./assets/fonts/galioExtra";
import { YellowBox } from "react-native";
YellowBox.ignoreWarnings(["ReactNative.NativeModules.LottieAnimationView"]);
import RegistrationNavigator from "./navigation/RegistrationNavigator";
const GalioExtra = require("./assets/fonts/galioExtra.ttf");
const Galio = require("./assets/fonts/galio.ttf");
export class App extends React.Component {
state = {
isLoadingComplete: false,
isLoggedIn: false
};
constructor(props) {
super(props);
}
render() {
if (!this.state.isLoadingComplete && !this.props.skipLoadingScreen) {
return (
<AppLoading
startAsync={this._loadResourcesAsync}
onError={this._handleLoadingError}
onFinish={this._handleFinishLoading}
/>
);
} else {
//console.log("App Started");
return (
<View style={styles.container}>
{Platform.OS === "ios" && <StatusBar barStyle="default" />}
{this.props.isLoggedIn ? (
<AppNavigator
theme={this.props.theme}
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
) : (
<RegistrationNavigator
theme={this.props.theme}
ref={navigatorRef => {
NavigationService.setTopLevelNavigator(navigatorRef);
}}
/>
)}
</View>
);
}
}
_loadResourcesAsync = async () => {
return Promise.all([
Asset.loadAsync([
require("./assets/images/robot-dev.png"),
require("./assets/images/robot-prod.png")
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
...Ionicons.font,
GalioExtra: GalioExtra,
galio: Galio,
"poppins-bold": require("./assets/fonts/Poppins-Bold.ttf"),
// We include SpaceMono because we use it in HomeScreen.js. Feel free
// to remove this if you are not using it in your app
"space-mono": require("./assets/fonts/SpaceMono-Regular.ttf")
// "lato-hairline": require("./assets/fonts/Lato-Hairline.ttf"),
// "lato-light": require("./assets/fonts/Lato-Light.ttf"),
// "lato-regular": require("./assets/fonts/Lato-Regular.ttf"),
// "montserrat-bold": require("./assets/fonts/Montserrat-Bold.ttf"),
// "montserrat-light": require("./assets/fonts/Montserrat-Light.ttf"),
// "montserrat-regular": require("./assets/fonts/Montserrat-Regular.ttf"),
// "montserrat-thin": require("./assets/fonts/Montserrat-Thin.ttf"),
})
]);
};
_handleLoadingError = error => {
// In this case, you might want to report the error to your error
// reporting service, for example Sentry
console.warn(error);
};
_handleFinishLoading = () => {
this.setState({ isLoadingComplete: true });
};
}
const styles = theme =>
StyleSheet.create({
container: {
flex: 1,
backgroundColor: theme.COLORS.VIEW_BACKGROUND
}
});
export default connect(
state => ({
isLoggedIn: state.Auth.idToken !== null,
auth: state.Auth
}),
{ logout }
)(withGalio(App, styles));
Of course, the withGalio is inside the connect parameter, I am not sure if this does conflict in some way, even If I think it shouldn't.
Honestly, I understand that this sounds more like a help request than a bug report. However this behaviour started when, after upgrading to Expo v34/React Native 0.59. The application was broken because some properties from the custom theme I was using in the application broke. I realized that I was importing the theme from constants as material kit does, but the galio theme base property which I am pretty sure were there were not there anymore.
I read the documentation of galio theming to death but I can't figure out what am I doing wrong.
I can provide more code samples if useful.
Thanks to anyone that could provide a clear explanation on how to use the galio theming system and/or help me figure out the problem!
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
I am not sure if this is a bug related to Expo 34/RN0.59. Probably some misconfiguration on my side.
I thought the problem was related to Material Kit which I was trying to use, but after some investigating, I closed this creativetimofficial/material-kit-react-native#5 because it is definitely a problem I'm having with Galio's theme system
My application is built starting from an expo start. So it has an index.js and an App.js. I'm not sure this is common or if there is a better way, however, here are my two files.
index.js
I'm not sure if using withGalio here makes sense, but
customTheme
here has only the properties I defined. I assume this is correct, because it seems logical that theGalioProvider
components merges together GalioTheme with this custom properties object.Now, the App.js part.
If I use
withGalio
in it, in order to be able to use whatever constants I defined in the custom theme, everything gets broken.Meaning that my entire application is broken. I see that the components are cycling on the flat list but I see nothing on my app apart from a couple of mispositioned titles.
However,
(theme)
is populated with everything so I guess that the theming mechanism is working.app.js
Of course, the
withGalio
is inside theconnect
parameter, I am not sure if this does conflict in some way, even If I think it shouldn't.Honestly, I understand that this sounds more like a help request than a bug report. However this behaviour started when, after upgrading to Expo v34/React Native 0.59. The application was broken because some properties from the custom theme I was using in the application broke. I realized that I was importing the theme from
constants
as material kit does, but the galio theme base property which I am pretty sure were there were not there anymore.I read the documentation of galio theming to death but I can't figure out what am I doing wrong.
I can provide more code samples if useful.
Thanks to anyone that could provide a clear explanation on how to use the galio theming system and/or help me figure out the problem!
The text was updated successfully, but these errors were encountered: