Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward core StyleSheet properties #33

Closed
mehcode opened this issue Mar 23, 2017 · 4 comments
Closed

Forward core StyleSheet properties #33

mehcode opened this issue Mar 23, 2017 · 4 comments

Comments

@mehcode
Copy link

mehcode commented Mar 23, 2017

Brilliant extension, thanks.

It'd be nice to be able to magically do:

// But really get EStyleSheet
import {StyleSheet} from "react-native";

I'm currently settling on this (until I figure out a nice way to do the above):

import StyleSheet from "react-native-extended-stylesheet";

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.

@vitalets
Copy link
Owner

// 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.

@mehcode
Copy link
Author

mehcode commented Mar 23, 2017

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.

@vitalets
Copy link
Owner

Ok, I get your point.
Could you show how your require for example, Text component?
Something like this?

import {Text} from `./overriden-text';

@joemckie
Copy link
Contributor

joemckie commented Apr 11, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants