diff --git a/README.md b/README.md index 4d7b3f7..dd27778 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ npm install @remobile/react-native-action-sheet --save ```js 'use strict'; -var React = require('react-native'); -var { +import React from 'react'; +import { StyleSheet, TouchableOpacity, View, -} = React; +} from 'react-native'; var ActionSheet = require('@remobile/react-native-action-sheet'); var Button = require('@remobile/react-native-simple-button'); diff --git a/button.js b/button.js index f1370d1..6479ec2 100644 --- a/button.js +++ b/button.js @@ -4,8 +4,13 @@ */ 'use strict' -var React = require('react-native'); -var { StyleSheet, Text, TouchableOpacity, View } = React; +import React from 'react'; +import { + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; module.exports = React.createClass({ render: function() { diff --git a/index.js b/index.js index 0b715a0..3a2de33 100644 --- a/index.js +++ b/index.js @@ -6,16 +6,16 @@ */ 'use strict'; -var React = require('react-native'); -var { +import React from 'react'; +import { StyleSheet, TouchableOpacity, View, -} = React; +} from 'react-native'; -var Button = require('./button.js'); -var Overlay = require('./overlay.js'); -var Sheet = require('./sheet.js'); +import Button from './button.js'; +import Overlay from './overlay.js'; +import Sheet from './sheet.js'; module.exports = React.createClass({ getDefaultProps: function() { diff --git a/overlay.js b/overlay.js index e6c4231..78edcd8 100644 --- a/overlay.js +++ b/overlay.js @@ -4,8 +4,13 @@ */ 'use strict'; -var React = require('react-native'); -var { Animated, StyleSheet, View, Dimensions} = React; +import React from 'react'; +import { + Animated, + StyleSheet, + View, + Dimensions, +} from 'react-native'; const DEFAULT_ANIMATE_TIME = 300; diff --git a/package.json b/package.json index 56aefd7..a49ac77 100644 --- a/package.json +++ b/package.json @@ -1,30 +1,30 @@ { - "name": "@remobile/react-native-action-sheet", - "version": "1.0.1", - "description": "A pure js ActionSheet like ios ActionSheet, support ios and android", - "main": "index.js", - "author": { - "name": "YunJiang.Fang", - "email": "42550564@qq.com" - }, - "license": "MIT", - "keywords": [ - "react-native", - "react-component", - "ios", - "android", - "action sheet", - "ActionSheet", - "animation", - "remobile", - "mobile" - ], - "homepage": "https://github.com/remobile/react-native-action-sheet", - "bugs": { - "url": "https://github.com/remobile/react-native-action-sheet/issues" - }, - "repository": { - "type": "git", - "url": "git://github.com/remobile/react-native-action-sheet.git" - } + "name": "react-native-action-sheet", + "version": "2.0.0", + "description": "A pure js ActionSheet like ios ActionSheet, support ios and android", + "main": "index.js", + "author": { + "name": "YunJiang.Fang", + "email": "42550564@qq.com" + }, + "license": "MIT", + "keywords": [ + "react-native", + "react-component", + "ios", + "android", + "action sheet", + "ActionSheet", + "animation", + "remobile", + "mobile" + ], + "homepage": "https://github.com/remobile/react-native-action-sheet", + "bugs": { + "url": "https://github.com/remobile/react-native-action-sheet/issues" + }, + "repository": { + "type": "git", + "url": "git://github.com/remobile/react-native-action-sheet.git" + } } diff --git a/sheet.js b/sheet.js index 1001310..15d415b 100644 --- a/sheet.js +++ b/sheet.js @@ -4,8 +4,13 @@ */ 'use strict'; -var React = require('react-native'); -var { Animated, StyleSheet, View, Dimensions} = React; +import React from 'react'; +import { + Animated, + StyleSheet, + View, + Dimensions, +} from 'react-native'; const DEFAULT_BOTTOM = -300; const DEFAULT_ANIMATE_TIME = 300;