From 5efe8d88dbbf7cefc6737b49690332c010034595 Mon Sep 17 00:00:00 2001 From: nitaking <10850034+nitaking@users.noreply.github.com> Date: Sat, 10 Nov 2018 20:24:03 +0900 Subject: [PATCH] Fix Deprecation Warnings React v15.5.0 --- src/index.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/index.js b/src/index.js index 8da182b..709e461 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ 'use strict'; -import React, { PropTypes } from 'react'; +import React from 'react'; +import PropTypes from 'prop-types'; +import createReactClass from 'create-react-class'; import tweenState from 'react-tween-state'; import { @@ -10,19 +12,19 @@ import { Text } from 'react-native'; -var Accordion = React.createClass({ +var Accordion = createReactClass({ mixins: [tweenState.Mixin], propTypes: { - activeOpacity: React.PropTypes.number, - animationDuration: React.PropTypes.number, - content: React.PropTypes.element.isRequired, - easing: React.PropTypes.string, - expanded: React.PropTypes.bool, - header: React.PropTypes.element.isRequired, - onPress: React.PropTypes.func, - underlayColor: React.PropTypes.string, - style: React.PropTypes.object + activeOpacity: PropTypes.number, + animationDuration: PropTypes.number, + content: PropTypes.element.isRequired, + easing: PropTypes.string, + expanded: PropTypes.bool, + header: PropTypes.element.isRequired, + onPress: PropTypes.func, + underlayColor: PropTypes.string, + style: PropTypes.object }, getDefaultProps() {