Closed lucasff closed 7 years ago
Yes, you can create global style file
// global.js
export EStyleSheet.create({
...
});
and use it in all other components:
// component
import style from `./global`;
...
AFAIK React Native can not automatically apply some style to components.
I know a new way to create Global style, and if we're combined react-native-extended-stylesheet, It's so crazy :) Need create a new file Global.js, create a global variable like this.
export styles = EStyleSheet.create({
container :{
flex: 1,
justifyContent:'center',
alignItems:'center'
}
}) ,
....
global.GlobalStyle = styles;
Now simpler to import ./Global.js to App.js (file root) All app you can use: GlobalStyle.container
It is possible to have global styles, like we have in CSS?