Skip to content

Commit

Permalink
Expand proptypes
Browse files Browse the repository at this point in the history
  • Loading branch information
treyhuffine committed Oct 30, 2018
1 parent 2f2062b commit 1641f0b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/lightbox-react.js
Expand Up @@ -1563,21 +1563,28 @@ class ReactImageLightbox extends Component {
}
}

const srcTypes = PropTypes.oneOfType([
PropTypes.string,
PropTypes.func,
PropTypes.element,
PropTypes.node,
]);

ReactImageLightbox.propTypes = {
//-----------------------------
// Image sources
//-----------------------------

// Main display image url
mainSrc: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).isRequired, // eslint-disable-line react/no-unused-prop-types
mainSrc: srcTypes.isRequired, // eslint-disable-line react/no-unused-prop-types

// Previous display image url (displayed to the left)
// If left undefined, movePrev actions will not be performed, and the button not displayed
prevSrc: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
prevSrc: srcTypes,

// Next display image url (displayed to the right)
// If left undefined, moveNext actions will not be performed, and the button not displayed
nextSrc: PropTypes.oneOfType([PropTypes.string, PropTypes.func]),
nextSrc: srcTypes,

//-----------------------------
// Image thumbnail sources
Expand Down

0 comments on commit 1641f0b

Please sign in to comment.