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 { class AutocompleteInput extends React.Component {
static propTypes = { static propTypes = {
value: React.PropTypes.string.isRequired, value: React.PropTypes.string,
options: React.PropTypes.array.isRequired, options: React.PropTypes.array,
style: React.PropTypes.object, style: React.PropTypes.object,
onChange: React.PropTypes.func.isRequired, onChange: React.PropTypes.func,
}
static defaultProps = {
onChange: () => {},
options: [],
} }
render() { render() {

View file

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

View file

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