Skip to content

Commit

Permalink
fix(gatsby-image): Remove onClick prop (#19458)
Browse files Browse the repository at this point in the history
  • Loading branch information
madalynrose authored and sidharthachatterjee committed Nov 13, 2019
1 parent bba2c2f commit 0da6dbb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
3 changes: 1 addition & 2 deletions packages/gatsby-image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,7 @@ While you could achieve a similar effect with plain CSS media queries, `gatsby-i
| `fluid` | `object` / `array` | Data returned from the `fluid` query. When prop is an array it has to be combined with `media` keys, allows for art directing `fluid` images. |
| `fadeIn` | `bool` | Defaults to fading in the image on load |
| `durationFadeIn` | `number` | fading duration is set up to 500ms by default |
| `title` | `string` | Passed to the `img` element |
| `onClick` | `func` | Passed to the `img` element |
| `title` | `string` | Passed to the `img` element | |
| `alt` | `string` | Passed to the `img` element. Defaults to an empty string `alt=""` |
| `crossOrigin` | `string` | Passed to the `img` element |
| `className` | `string` / `object` | Passed to the wrapper element. Object is needed to support Glamor's css prop |
Expand Down
1 change: 0 additions & 1 deletion packages/gatsby-image/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ interface GatsbyImageProps {
backgroundColor?: string | boolean
onLoad?: () => void
onError?: (event: any) => void
onClick?: () => void
onStartLoad?: (param: { wasCached: boolean }) => void
Tag?: string
itemProp?: string
Expand Down
6 changes: 0 additions & 6 deletions packages/gatsby-image/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ const Img = React.forwardRef((props, ref) => {
style,
onLoad,
onError,
onClick,
loading,
draggable,
...otherProps
Expand All @@ -253,7 +252,6 @@ const Img = React.forwardRef((props, ref) => {
{...otherProps}
onLoad={onLoad}
onError={onError}
onClick={onClick}
ref={ref}
loading={loading}
draggable={draggable}
Expand All @@ -274,7 +272,6 @@ const Img = React.forwardRef((props, ref) => {
Img.propTypes = {
style: PropTypes.object,
onError: PropTypes.func,
onClick: PropTypes.func,
onLoad: PropTypes.func,
}

Expand Down Expand Up @@ -492,7 +489,6 @@ class Image extends React.Component {
ref={this.imageRef}
onLoad={this.handleImageLoaded}
onError={this.props.onError}
onClick={this.props.onClick}
itemProp={itemProp}
loading={loading}
draggable={draggable}
Expand Down Expand Up @@ -593,7 +589,6 @@ class Image extends React.Component {
ref={this.imageRef}
onLoad={this.handleImageLoaded}
onError={this.props.onError}
onClick={this.props.onClick}
itemProp={itemProp}
loading={loading}
draggable={draggable}
Expand Down Expand Up @@ -680,7 +675,6 @@ Image.propTypes = {
backgroundColor: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
onLoad: PropTypes.func,
onError: PropTypes.func,
onClick: PropTypes.func,
onStartLoad: PropTypes.func,
Tag: PropTypes.string,
itemProp: PropTypes.string,
Expand Down

0 comments on commit 0da6dbb

Please sign in to comment.