Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-image-fallback

Package Overview
Dependencies
Maintainers
2
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-fallback - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0

2

package.json
{
"name": "react-image-fallback",
"version": "5.0.0",
"version": "6.0.0",
"description": "if your image doesn't exist, fallback onto another provided image.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -55,3 +55,3 @@ # React Image Fallback

Copyright (C) 2016 Social Tables, Inc. (https://www.socialtables.com) All rights reserved.
Copyright (C) 2017 Social Tables, Inc. (https://www.socialtables.com) All rights reserved.

@@ -58,0 +58,0 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

@@ -1,2 +0,2 @@

import PropTypes from 'prop-types'
import PropTypes from "prop-types"
import React, { Component } from "react";

@@ -30,5 +30,6 @@ import filterInvalidDOMProps from "filter-invalid-dom-props";

}
setDisplayImage({ image, fallbacks }) {
const imagesArray = [image].concat(fallbacks);
const fallbacksArray = Array.isArray(fallbacks) ? fallbacks : [fallbacks];
const imagesArray = image ? [image].concat(fallbacksArray) : fallbacksArray;
this.displayImage.onerror = () => {

@@ -73,3 +74,3 @@ if (imagesArray.length > 2 && typeof imagesArray[1] === "string") {

ReactImageFallback.propTypes = {
src: PropTypes.string.isRequired,
src: PropTypes.string,
fallbackImage: PropTypes.oneOfType([PropTypes.string, PropTypes.element, PropTypes.array]).isRequired,

@@ -76,0 +77,0 @@ initialImage: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc