vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

Outline for debugging not working? #51

Closed AnthonyLamot closed 6 years ago

AnthonyLamot commented 7 years ago

From: https://github.com/vitalets/react-native-extended-stylesheet#outline-for-debug

I just gave it a try but didn't manage to get it working. Any ideas?

import EStyleSheet from 'react-native-extended-stylesheet';
EStyleSheet.build({ $outline: 1 });

In my app/index.js

vitalets commented 7 years ago

Will re-check! thank you!

vitalets commented 6 years ago

I tried with example for readme screenshot - everything works for me:

// app.js
EStyleSheet.build({
  $textColor: 'black',
  $buttonColor: '#679267',
  $outline: 1, // outline!
  $rem: 18,
});

image

Could you re-check and reopen with your code if problem still exists. I assume issue was related with typo in docs. Thanks!

AnthonyLamot commented 6 years ago

Hi @vitalets, sorry for not getting back sooner. Unfortunately I don't get it to work yet.

From my index.js:

import Meteor from 'react-native-meteor';
import React from 'react';
import EStyleSheet from 'react-native-extended-stylesheet';

import settings from './config/settings';
import { AlertProvider } from './components/Alert';
import RootStack from './config/routes';

Meteor.connect(settings.SERVER_URL);

EStyleSheet.build({ $outline: 1 }); // not working?

const App = () => (
  <AlertProvider>
    <RootStack />
  </AlertProvider>
);

export default App;

This file is located in an App folder. There are separate index.js files to initiate on Android or iOS, but I don't think that should be a problem?

I am using react-native run-android on a connected device, but I think that is fine too?

vitalets commented 6 years ago

@AnthonyLamot it's my mistake in docs - only components that are using EStyleSheet will be outlined. I've updated readme. Thanks for pointing on that! 👍

AnthonyLamot commented 6 years ago

@vitalets that actually makes a lot of sense. I simply had not considered it. Thank you for clarifying and your help! (As well as updating the doc.)