Fix React type warnings

This commit is contained in:
Lukas Martinelli 2016-12-31 10:39:30 +01:00
parent b50855a4a9
commit 03796c963b
3 changed files with 24 additions and 9 deletions

View file

@ -6,10 +6,15 @@ import { margins, fontSizes } from '../../config/scales'
class AutocompleteInput extends React.Component {
static propTypes = {
value: React.PropTypes.string.isRequired,
options: React.PropTypes.array.isRequired,
value: React.PropTypes.string,
options: React.PropTypes.array,
style: React.PropTypes.object,
onChange: React.PropTypes.func.isRequired,
onChange: React.PropTypes.func,
}
static defaultProps = {
onChange: () => {},
options: [],
}
render() {

View file

@ -7,9 +7,14 @@ import AutocompleteInput from '../inputs/AutocompleteInput'
class LayerSourceBlock extends React.Component {
static propTypes = {
value: React.PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired,
sourceIds: React.PropTypes.array.isRequired,
value: React.PropTypes.string,
onChange: React.PropTypes.func,
sourceIds: React.PropTypes.array,
}
static defaultProps = {
onChange: () => {},
sourceIds: [],
}
render() {

View file

@ -7,9 +7,14 @@ import AutocompleteInput from '../inputs/AutocompleteInput'
class LayerSourceLayer extends React.Component {
static propTypes = {
value: React.PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired,
sourceLayerIds: React.PropTypes.array.isRequired,
value: React.PropTypes.string,
onChange: React.PropTypes.func,
sourceLayerIds: React.PropTypes.array,
}
static defaultProps = {
onChange: () => {},
sourceLayerIds: [],
}
render() {