Closed mehcode closed 7 years ago
// But really get EStyleSheet import {StyleSheet} from "react-native";
hi @mehcode !
I think this may be confusing for people coming/reviewing your project as it is very implicit. They will look documentation on native StyleSheet
but will not see some methods.
It'd be neat if flatten, harilineWidth, etc. were exposed on EStyleSheet.
this one I like! We can derive EStyleSheet from native StyleSheet.
I think this may be confusing for people coming/reviewing your project as it is very implicit. They will look documentation on native StyleSheet but will not see some methods.
One small annoyance I have with my RN setup is I have a number of core components that you should not use when coming into one of my projects. Eg. you should not be using Text
from react-native
and instead should be requiring the local Text
component (because of some default properties like a custom fontFamily). It's a pain to lint for that.
That's about as hard to communicate to the random developer as a core component being overridden and harder to maintain.
Ok, I get your point.
Could you show how your require
for example, Text
component?
Something like this?
import {Text} from `./overriden-text';
@mehcode I don't like that at all. Importing StyleSheet
should return react native's stylesheet, and shouldn't be modified by an external library.
Your text component, in my opinion, is completely different, as it's clear that you're requiring a custom component.
Brilliant extension, thanks.
It'd be nice to be able to magically do:
I'm currently settling on this (until I figure out a nice way to do the above):
The problem is EStyleSheet is not a drop-in replacement for the core StyleSheet.
It'd be neat if
flatten
,harilineWidth
, etc. were exposed on EStyleSheet.