How to use the react-native.PropTypes function in react-native

To help you get started, we’ve selected a few react-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scrollback / io.scrollback.neighborhoods / app / views / AvatarRound.js View on Github external
const { size } = this.props;

		return (
			
		);
	}
}

AvatarRound.propTypes = {
	size: React.PropTypes.number.isRequired,
	nick: React.PropTypes.string.isRequired
};
github scrollback / io.scrollback.neighborhoods / app / views / BannerOffline.js View on Github external
default:
			label = '';
		}

		return (
			
		);
	}
}

BannerOffline.propTypes = {
	connectionStatus: React.PropTypes.oneOf([ 'offline', 'connecting', 'online' ])
};
github xiekw2010 / react-native-gitfeed / AppComponents / EditProfileComponent.js View on Github external
);
    } else {
      return (
        
      );
    }
  },
});

const InputField = React.createClass({

  propTypes:{
    //Input field configuration used for setting up.
    config:React.PropTypes.object,
    //Call when input text changes.
    diffCallback:React.PropTypes.func,
    //Keep the original value for diff checking.
    originValue:React.PropTypes.string,
    //Call when inputField is focused.
    onFocusCallback:React.PropTypes.func,
    //Call when press return.
    onSubmitEditing:React.PropTypes.func,
  },

  getInitialState() {
    return {
      //The text of input field.
      value:this.props.originValue,
      //Used for display email list.
      emaliListViewHeight:0,
github tylermcginnis / react-native-gh-notetaker / App / Components / Notes.js View on Github external
render(){
    return (
      
    )
  }
};

Notes.propTypes = {
  userInfo: React.PropTypes.object.isRequired,
  notes: React.PropTypes.object.isRequired
}

module.exports = Notes;
github gbuszmicz / firebase-auth-app / src / scenes / Register.js View on Github external
}
}
const mapDispatchToProps = (dispatch) => {
  return {
    registerRequest: (creds) => dispatch(registerRequest(creds)),
    registerSuccess: (user) => dispatch(registerSuccess(user)),
    registerFailure: (errorMessage) => dispatch(registerFailure(errorMessage)),
    loginSuccess: (user) => dispatch(loginSuccess(user)),
    loginFailure: (errorMessage) => dispatch(loginFailure(errorMessage))
  };
}

Register.propTypes = {
  currentUser: React.PropTypes.object.isRequired,
  registerRequest: React.PropTypes.func.isRequired,
  registerSuccess: React.PropTypes.func.isRequired,
  registerFailure: React.PropTypes.func.isRequired,
  loginSuccess: React.PropTypes.func.isRequired,
  loginFailure: React.PropTypes.func.isRequired,
  navigator: React.PropTypes.object.isRequired
}

export default connect(
  mapStateToProps, 
  mapDispatchToProps
)(Register);
github este / este / src / components / header.react.js View on Github external
import React, {Text, View, Image, TouchableOpacity} from 'react-native';
import Component from '../components/component.react';

import style from './header.style';

export default class Header extends Component {

  static propTypes = {
    backButtonAction: React.PropTypes.func,
    menuButtonAction: React.PropTypes.func,
    title: React.PropTypes.string.isRequired
  }

  render() {
    const {title, menuButtonAction, backButtonAction} = this.props;

    return (
github scrollback / io.scrollback.neighborhoods / app / views / growing-text-input.js View on Github external
this._input = c}
					value={this.state.value}
					onChange={this._onChange.bind(this)}
					style={this.props.inputStyle}
					multiline
				/>
			
		);
	}
}

GrowingTextInput.propTypes = {
	value: React.PropTypes.string,
	defaultValue: React.PropTypes.string,
	placeholder: React.PropTypes.string,
	numberOfLines: React.PropTypes.number,
	onChange: React.PropTypes.func,
	onValueChange: React.PropTypes.func,
	inputStyle: React.PropTypes.any
};
github nosovsh / fifteen / src / Modal.js View on Github external
var React = require('react-native');
var Dimensions = require('Dimensions');

var screen = Dimensions.get('window');

var {
  StyleSheet,
  View,
  Animated,
  } = React;


var Modal = React.createClass({
  propTypes: {
    children: React.PropTypes.node.isRequired,
    isOpen: React.PropTypes.bool.isRequired,
  },

  getInitialState: function() {
    return {
      position: new Animated.Value(this.props.isOpen ? 0 : screen.height),
      visible: this.props.isOpen,
    };
  },

  componentWillReceiveProps(nextProps) {
    if (!this.props.isOpen && nextProps.isOpen) {
      this.animateOpen();
    } else if (this.props.isOpen && !nextProps.isOpen) {
      this.animateClose();
    }
  },
github tylermcginnis / react-native-gh-notetaker / App / Components / Helpers / WebView.js View on Github external
flexDirection: 'column',
  },
});

class Web extends React.Component{
  render() {
    return (
      
    );
  }
};

Web.propTypes = {
 url: React.PropTypes.string.isRequired
};

module.exports = Web;
github scrollback / io.scrollback.neighborhoods / views / components / card-hashtags.js View on Github external
(this.props.hashtags.length !== nextProps.hashtags.length) ||
				!this.props.hashtags.every((el, i) => el === nextProps.hashtags[i])
			);
	}

	render() {
		return (
			
		);
	}
}

CardHashtags.propTypes = {
	hashtags: React.PropTypes.arrayOf(React.PropTypes.string)
};