Skip to content

Commit 48e2d3b

Browse files
committed
Usa ES6 en el index
1 parent 08052d8 commit 48e2d3b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
var react = require('react-native');
2-
var Dimensions = react.Dimensions;
3-
var RNMeasureText = react.NativeModules.RNMeasureText;
1+
import { Dimensions, NativeModules } from 'react-native';
2+
3+
const RNMeasureText = NativeModules.RNMeasureText;
44

55
/**
66
* Get width, height, lineCount, and lastLineWidth values for text.
77
*
88
* @param {object} params - Info
99
*/
10-
exports.measure = function measure (params) {
10+
export function measure (params) {
1111

12-
var fontSize = params && params.fontSize
12+
const fontSize = params && params.fontSize
1313

1414
if (typeof fontSize !== 'number') {
1515
return Promise.reject(new Error('missing required \'fontSize\' property'));
1616
}
1717

18-
var fontScale = Dimensions.get('window').fontScale || 1;
18+
const fontScale = Dimensions.get('window').fontScale || 1;
1919

2020
if (fontScale !== 1) {
2121
params = Object.assign(

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-text-size",
3-
"version": "1.0.0-alpha.10",
3+
"version": "1.0.0-beta.1",
44
"description": "Measure text height and width without laying it out.",
55
"main": "index.js",
66
"types": "./index.d.ts",

0 commit comments

Comments
 (0)