From acc7ce13f864d1b9cdc30581b2a1f53f4064c9f6 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Wed, 5 Dec 2018 22:38:02 +0100 Subject: [PATCH] Adds prop types to the project & and uses them in SettingsButton component --- components/settings/password/settings-button.js | 6 ++++++ package.json | 1 + 2 files changed, 7 insertions(+) diff --git a/components/settings/password/settings-button.js b/components/settings/password/settings-button.js index 3b29241..97272bb 100644 --- a/components/settings/password/settings-button.js +++ b/components/settings/password/settings-button.js @@ -1,4 +1,5 @@ import React from 'react' +import PropTypes from 'prop-types' import { TouchableOpacity } from 'react-native' import AppText from '../../app-text' @@ -20,4 +21,9 @@ const SettingsButton = ({ children, ...props }) => { ) } +SettingsButton.propTypes = { + onPress: PropTypes.func.isRequired, + disabled: PropTypes.bool +} + export default SettingsButton \ No newline at end of file diff --git a/package.json b/package.json index e01b525..3cb33ad 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "nodejs-mobile-react-native": "^0.3.0", "object-path": "^0.11.4", "obv": "0.0.1", + "prop-types": "^15.6.2", "react": "16.4.1", "react-native": "~0.56.0", "react-native-calendars": "^1.19.3",