Permalink
Browse files

Fix stylesheet registery

Reviewed By: fkgozali

Differential Revision: D5685564

fbshipit-source-id: 0946223108041575b16f05abff4a90867c6323f2
  • Loading branch information...
sahrens authored and facebook-github-bot committed Aug 23, 2017
1 parent 2172bb4 commit 68664ac1061c01a7245533c8681cd810cd048a29
Showing with 10 additions and 10 deletions.
  1. +10 −10 Libraries/StyleSheet/StyleSheet.js
@@ -11,17 +11,17 @@
*/
'use strict';
var PixelRatio = require('PixelRatio');
var ReactNativePropRegistry = require('ReactNativePropRegistry');
var ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
var StyleSheetValidation = require('StyleSheetValidation');
const PixelRatio = require('PixelRatio');
const ReactNativePropRegistry = require('ReactNativePropRegistry');
const ReactNativeStyleAttributes = require('ReactNativeStyleAttributes');
const StyleSheetValidation = require('StyleSheetValidation');
var flatten = require('flattenStyle');
const flatten = require('flattenStyle');
export type Styles = {[key: string]: Object};
export type StyleSheet<S: Styles> = {[key: $Keys<S>]: number};
var hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
let hairlineWidth = PixelRatio.roundToNearestPixel(0.4);
if (hairlineWidth === 0) {
hairlineWidth = 1 / PixelRatio.get();
}
@@ -41,7 +41,7 @@ const absoluteFill = ReactNativePropRegistry.register(absoluteFillObject); // Th
* Create a new StyleSheet:
*
* ```
* var styles = StyleSheet.create({
* const styles = StyleSheet.create({
* container: {
* borderRadius: 4,
* borderWidth: 0.5,
@@ -135,7 +135,7 @@ module.exports = {
*
* Example:
* ```
* var styles = StyleSheet.create({
* const styles = StyleSheet.create({
* listItem: {
* flex: 1,
* fontSize: 16,
@@ -196,9 +196,9 @@ module.exports = {
*/
create<S: Styles>(obj: S): StyleSheet<S> {
const result: StyleSheet<S> = {};
for (var key in obj) {
for (const key in obj) {
StyleSheetValidation.validateStyle(key, obj);
result[key] = ReactNativePropRegistry.register(obj[key]);
result[key] = obj[key] && ReactNativePropRegistry.register(obj[key]);
}
return result;
},

0 comments on commit 68664ac

Please sign in to comment.